From 74a4e03661206f4eda597c31d0933272c3050d9b Mon Sep 17 00:00:00 2001 From: Nafies Luthfi Date: Sun, 19 Apr 2020 17:20:50 +0800 Subject: [PATCH] fix: Declare primary key type https://laravel.com/docs/6.x/upgrade#eloquent-primary-key-type --- app/Couple.php | 9 ++++++++- app/User.php | 7 +++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/app/Couple.php b/app/Couple.php index b801c19..e20b942 100644 --- a/app/Couple.php +++ b/app/Couple.php @@ -2,8 +2,8 @@ namespace App; -use Ramsey\Uuid\Uuid; use Illuminate\Database\Eloquent\Model; +use Ramsey\Uuid\Uuid; class Couple extends Model { @@ -14,6 +14,13 @@ class Couple extends Model */ public $incrementing = false; + /** + * The "type" of the primary key ID. + * + * @var string + */ + protected $keyType = 'string'; + public function husband() { return $this->belongsTo(User::class); diff --git a/app/User.php b/app/User.php index a9dd05a..26bafb6 100644 --- a/app/User.php +++ b/app/User.php @@ -19,6 +19,13 @@ class User extends Authenticatable public $incrementing = false; /** + * The "type" of the primary key ID. + * + * @var string + */ + protected $keyType = 'string'; + + /** * The attributes that are mass assignable. * * @var array