Skip to content

Commit 9c6b579

Browse files
author
EllaiSys
committed
fix: update the user model to handle the primary key
1 parent 738d80f commit 9c6b579

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

app/Models/User.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ class User extends Authenticatable
1212
{
1313
use HasApiTokens, HasFactory, Notifiable;
1414

15+
/**
16+
* The primary key for the model.
17+
*
18+
* @var string
19+
*/
20+
protected $primaryKey = null;
21+
1522
/**
1623
* The attributes that are mass assignable.
1724
*
@@ -42,4 +49,18 @@ class User extends Authenticatable
4249
protected $casts = [
4350
'email_verified_at' => 'datetime',
4451
];
52+
53+
54+
/**
55+
* Create a new user instance.
56+
*
57+
* @param array $attributes
58+
* @return void
59+
*/
60+
public function __construct(array $attributes = [])
61+
{
62+
parent::__construct($attributes);
63+
64+
$this->primaryKey = config('cognito.user_subject_uuid', 'id');
65+
}
4566
}

0 commit comments

Comments
 (0)