File tree Expand file tree Collapse file tree 1 file changed +16
-12
lines changed
Expand file tree Collapse file tree 1 file changed +16
-12
lines changed Original file line number Diff line number Diff line change 33namespace App;
44
55use Illuminate\Database\Eloquent\Model;
6-
6+ use Illuminate\Database\Eloquent\Relations\BelongsTo;
77use Oneofftech\Identities\Facades\Identity as IdentityFacade;
88
99class Identity extends Model
1010{
11-
12- /**
13- * @var array
14- */
15- protected $casts = [
16- 'expires_at' => 'datetime',
17- 'registration' => 'bool',
18- ];
19-
2011 /**
2112 * @var array
2213 */
@@ -39,11 +30,24 @@ class Identity extends Model
3930 'refresh_token',
4031 'expires_at',
4132 ];
42-
33+
4334 /**
35+ * Get the attributes that should be cast.
4436 *
37+ * @return array<string, string>
38+ */
39+ protected function casts(): array
40+ {
41+ return [
42+ 'expires_at' => 'datetime',
43+ 'registration' => 'bool',
44+ ];
45+ }
46+
47+ /**
48+ * The user to whom this identity belongs.
4549 */
46- public function user()
50+ public function user(): BelongsTo
4751 {
4852 return $this->belongsTo(IdentityFacade::userModel());
4953 }
You can’t perform that action at this time.
0 commit comments