Total Complexity | 2 |
Total Lines | 56 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
11 | class User extends Authenticatable |
||
12 | { |
||
13 | use HasRoles; |
||
|
|||
14 | use HasApiTokens; |
||
15 | use Notifiable; |
||
16 | use SoftDeletes; |
||
17 | |||
18 | protected $connection = 'tenant'; |
||
19 | |||
20 | /** |
||
21 | * The attributes that are mass assignable. |
||
22 | * |
||
23 | * @var array |
||
24 | */ |
||
25 | protected $fillable = [ |
||
26 | 'name', 'email', 'password', |
||
27 | ]; |
||
28 | |||
29 | /** |
||
30 | * The attributes that should be hidden for arrays. |
||
31 | * |
||
32 | * @var array |
||
33 | */ |
||
34 | protected $hidden = [ |
||
35 | 'password', 'remember_token', |
||
36 | ]; |
||
37 | |||
38 | /** |
||
39 | * The attributes that should be cast to native types. |
||
40 | * |
||
41 | * @var array |
||
42 | */ |
||
43 | protected $casts = [ |
||
44 | 'email_verified_at' => 'datetime', |
||
45 | ]; |
||
46 | |||
47 | /** |
||
48 | * Find the user instance for the given username. |
||
49 | * |
||
50 | * @param string $username |
||
51 | * |
||
52 | * @return User |
||
53 | */ |
||
54 | public function findForPassport($username) |
||
55 | { |
||
56 | return $this->where('email', $username)->where('pending_invitation', 0)->first(); |
||
57 | } |
||
58 | |||
59 | /** |
||
60 | * Used to determine access rights if a user has limited role. |
||
61 | * |
||
62 | * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany |
||
63 | */ |
||
64 | public function grantedRecruitments() |
||
67 | } |
||
68 | } |
||
69 |