1 | <?php namespace JobApis\JobsToMail\Models; |
||
8 | class User extends Model |
||
9 | { |
||
10 | use Notifiable, SoftDeletes; |
||
11 | |||
12 | /** |
||
13 | * Indicates that the IDs are not auto-incrementing. |
||
14 | * |
||
15 | * @var bool |
||
16 | */ |
||
17 | public $incrementing = false; |
||
18 | |||
19 | /** |
||
20 | * The attributes that are mass assignable. |
||
21 | * |
||
22 | * @var array |
||
23 | */ |
||
24 | protected $fillable = [ |
||
25 | 'email', |
||
26 | ]; |
||
27 | |||
28 | /** |
||
29 | * Boot function from laravel. |
||
30 | */ |
||
31 | 12 | protected static function boot() |
|
39 | |||
40 | /** |
||
41 | * Defines the relationship to Search model |
||
42 | * |
||
43 | * @return \Illuminate\Database\Eloquent\Relations\HasMany |
||
44 | */ |
||
45 | public function searches() |
||
46 | { |
||
47 | return $this->hasMany(Search::class); |
||
48 | } |
||
49 | |||
50 | /** |
||
51 | * Defines the relationship to Token model |
||
52 | * |
||
53 | * @return \Illuminate\Database\Eloquent\Relations\HasMany |
||
54 | */ |
||
55 | public function tokens() |
||
56 | { |
||
57 | return $this->hasMany(Token::class); |
||
58 | } |
||
59 | |||
60 | /** |
||
61 | * Limits query to "confirmed" users |
||
62 | * |
||
63 | * @return \Illuminate\Database\Eloquent\Builder |
||
64 | */ |
||
65 | 2 | public function scopeConfirmed($query) |
|
69 | |||
70 | /** |
||
71 | * Limits query to "unconfirmed" users |
||
72 | * |
||
73 | * @param $query \Illuminate\Database\Eloquent\Builder |
||
74 | * |
||
75 | * @return \Illuminate\Database\Eloquent\Builder |
||
76 | */ |
||
77 | 1 | public function scopeUnconfirmed($query) |
|
81 | |||
82 | /** |
||
83 | * Get the entity's notifications. |
||
84 | */ |
||
85 | public function notifications() |
||
91 | } |
||
92 |