-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathUser.php
39 lines (32 loc) · 1.05 KB
/
User.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
namespace App\Models;
use Illuminate\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Concerns\HasUuids;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Foundation\Auth\Access\Authorizable;
use NiftyCo\Attachments\Casts\AsAttachment;
class User extends Model implements AuthenticatableContract, AuthorizableContract
{
use HasFactory, HasUuids, SoftDeletes, Authenticatable, Authorizable;
protected $guarded = ['id'];
protected $hidden = [
'password',
'remember_token',
];
protected function casts(): array
{
return [
'confirmed_at' => 'datetime',
'password' => 'hashed',
'avatar' => AsAttachment::class,
];
}
public function sessions()
{
return $this->hasMany(Session::class);
}
}