1 | <?php |
||
26 | class User extends Model implements AuthenticatableContract, |
||
27 | AuthorizableContract, |
||
28 | CanResetPasswordContract |
||
29 | { |
||
30 | use Authenticatable, Authorizable, CanResetPassword, SoftDeletes, AdminModelTrait; |
||
31 | |||
32 | /** |
||
33 | * The database table used by the model. |
||
34 | * |
||
35 | * @var string |
||
36 | */ |
||
37 | protected $table = 'users'; |
||
38 | |||
39 | /** |
||
40 | * The attributes that should be mutated to dates. |
||
41 | * |
||
42 | * @var array |
||
43 | */ |
||
44 | protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
||
45 | |||
46 | /** |
||
47 | * The attributes that are mass assignable. |
||
48 | * |
||
49 | * @var array |
||
50 | */ |
||
51 | protected $fillable = ['name', 'email', 'password', 'age', 'blacklisted', 'ip', 'activation_code', 'active', |
||
52 | 'fname', 'sname', 'bno', 'city', 'citypart', 'street', 'hno', 'zip', 'registration_data', 'phone']; |
||
53 | |||
54 | /** |
||
55 | * The attributes excluded from the model's JSON form. |
||
56 | * |
||
57 | * @var array |
||
58 | */ |
||
59 | protected $hidden = ['password', 'remember_token']; |
||
60 | |||
61 | /** |
||
62 | * Columns to exclude from index |
||
63 | * |
||
64 | * @var array |
||
65 | */ |
||
66 | protected $excludedFromIndex = ['password']; |
||
67 | |||
68 | /** |
||
69 | * Fields to search in fulltext mode |
||
70 | * |
||
71 | * @var array |
||
72 | */ |
||
73 | protected $fulltextFields = [ |
||
74 | 'id', |
||
75 | 'name' => [ |
||
76 | 'operator' => 'LIKE', |
||
77 | 'prefix' => '%', |
||
78 | 'sufix' => '%' |
||
79 | ], |
||
80 | 'email' => [ |
||
81 | 'operator' => 'LIKE', |
||
82 | 'prefix' => '%', |
||
83 | 'sufix' => '%' |
||
84 | ], |
||
85 | ]; |
||
86 | |||
87 | /** |
||
88 | * Default order by |
||
89 | * |
||
90 | * @var array |
||
91 | */ |
||
92 | protected $defaultOrderBy = [ |
||
93 | 'id' => 'desc' |
||
94 | ]; |
||
95 | |||
96 | /** |
||
97 | * Articles link |
||
98 | * |
||
99 | * @return object |
||
100 | */ |
||
101 | public function articles(){ |
||
105 | |||
106 | /** |
||
107 | * User group link |
||
108 | * |
||
109 | * @return object |
||
110 | */ |
||
111 | public function usergroups(){ |
||
115 | |||
116 | /** |
||
117 | * Process relationships |
||
118 | * |
||
119 | * @param query $query |
||
120 | * @return query |
||
121 | */ |
||
122 | public function scopeRelationships($query){ |
||
126 | } |
||
127 |