title: Laravel 5.7 - Invalid text representation: 7 ERROR: invalid input syntax for integer: \"10337e35-8da9-4600-b7de-792398eb6f48\"
body: <p>I'm trying to create a database notifcation in Laravel 5.7 and getting this SQL QueryException. My $notifiable variable in the toArray method is the user and this id in the exception: <code>invalid input syntax for integer: \"10337e35-8da9-4600-b7de-792398eb6f48\"</code> is the correct id for the user to be notified. I have my notifications table set up in the standard way: </p>
  
  <pre><code>Schema::create('notifications', function (Blueprint $table) {
          $table-&gt;uuid('id')-&gt;primary();
          $table-&gt;string('type');
          $table-&gt;morphs('notifiable');
          $table-&gt;text('data');
          $table-&gt;timestamp('read_at')-&gt;nullable();
          $table-&gt;timestamps();
      });
  </code></pre>
  
  <p>My user table is set up like this:</p>
  
  <pre><code>Schema::create('users', function (Blueprint $table) {
          $table-&gt;uuid('id');
          $table-&gt;primary('id');
          $table-&gt;string('name');
          $table-&gt;string('username')-&gt;unique();
          $table-&gt;string('email');
          $table-&gt;string('password');
          $table-&gt;rememberToken();
          $table-&gt;timestamps();
          $table-&gt;softDeletes();
      });
  </code></pre>
  
  <p>It is set up with a uuid as the primary id. Beyond that, the notification itself has <code>database</code> in the via method: </p>
  
  <pre><code>public function via($notifiable)
  {
      return ['database', 'mail'];
  }
  </code></pre>
  
  <p>I've set a couple properties in the toArray method. Nothing complicated. I also tried to manually insert into the notifications table and I can insert an entry with a <code>notifiable_id</code> as an int, but not a string/uuid. It's mind boggling to me that the nofiable system would not be set up to allow for uuid's as ids. Maybe it's just a small tweak, but I'm not seeing it out there and figure surely someone else has run into this. Cheers!</p>
  
  <p>Full exception: </p>
  
  <pre><code>Object { message: "SQLSTATE[22P02]: Invalid text representation: 7 ERROR:  invalid input syntax for integer: \"0e7cc3d8-bfca-41c1-99f8-6da9e8887465\" (SQL: insert into \"notifications\" (\"id\", \"type\", \"data\", \"read_at\", \"notifiable_id\", \"notifiable_type\", \"updated_at\", \"created_at\") values (f6206d4e-c98f-4ced-a1ee-6a755f073807, App\\Notifications\\BugTransition, {\"bug_id\":\"be14d750-ba6c-4e70-82f7-a36786ff37f4\",\"workflow_state\":\"accepted\"}, , 0e7cc3d8-bfca-41c1-99f8-6da9e8887465, App\\User, 2018-10-22 22:35:54, 2018-10-22 22:35:54))", exception: "Illuminate\\Database\\QueryException", file: "/srv/app/vendor/laravel/framework/src/Illuminate/Database/Connection.php", line: 664,
  </code></pre>