|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/* |
|
4
|
|
|
* rmarchiv.tk |
|
5
|
|
|
* (c) 2016-2017 by Marcel 'ryg' Hering |
|
6
|
|
|
*/ |
|
7
|
|
|
|
|
8
|
|
|
namespace App\Models; |
|
9
|
|
|
|
|
10
|
|
|
use Cog\Laravel\Ban\Traits\Bannable; |
|
11
|
|
|
use Cmgmyr\Messenger\Traits\Messagable; |
|
12
|
|
|
use GeneaLabs\LaravelModelCaching\Traits\Cachable; |
|
13
|
|
|
use Illuminate\Notifications\Notifiable; |
|
14
|
|
|
use Zizaco\Entrust\Traits\EntrustUserTrait; |
|
15
|
|
|
use Illuminate\Auth\Passwords\CanResetPassword; |
|
16
|
|
|
use Cog\Contracts\Ban\Bannable as BannableContract; |
|
17
|
|
|
use Illuminate\Foundation\Auth\User as Authenticatable; |
|
18
|
|
|
|
|
19
|
|
|
/* |
|
20
|
|
|
* App\User |
|
21
|
|
|
* |
|
22
|
|
|
* @property integer $id |
|
23
|
|
|
* @property string $name |
|
24
|
|
|
* @property string $email |
|
25
|
|
|
* @property string $password |
|
26
|
|
|
* @property integer $is_admin |
|
27
|
|
|
* @property string $remember_token |
|
28
|
|
|
* @property \Carbon\Carbon $created_at |
|
29
|
|
|
* @property \Carbon\Carbon $updated_at |
|
30
|
|
|
* @property-read \Illuminate\Notifications\DatabaseNotificationCollection|\Illuminate\Notifications\DatabaseNotification[] $notifications |
|
31
|
|
|
* @property-read \Illuminate\Notifications\DatabaseNotificationCollection|\Illuminate\Notifications\DatabaseNotification[] $readNotifications |
|
32
|
|
|
* @property-read \Illuminate\Notifications\DatabaseNotificationCollection|\Illuminate\Notifications\DatabaseNotification[] $unreadNotifications |
|
33
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\User whereId($value) |
|
34
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\User whereName($value) |
|
35
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\User whereEmail($value) |
|
36
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\User wherePassword($value) |
|
37
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\User whereIsAdmin($value) |
|
38
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\User whereRememberToken($value) |
|
39
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\User whereCreatedAt($value) |
|
40
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\User whereUpdatedAt($value) |
|
41
|
|
|
* @mixin \Eloquent |
|
42
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Game[] $games |
|
43
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\News[] $news |
|
44
|
|
|
* @property-read \App\Models\UserSetting $settings |
|
45
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Logo[] $logo |
|
46
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\LogoVote[] $logovote |
|
47
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\UserRole[] $roles |
|
48
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\UserObyx[] $userobyx |
|
49
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\Cmgmyr\Messenger\Models\Message[] $messages |
|
50
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\Cmgmyr\Messenger\Models\Participant[] $participants |
|
51
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\Cmgmyr\Messenger\Models\Thread[] $threads |
|
52
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\UserList[] $userlists |
|
53
|
|
|
*/ |
|
54
|
|
|
|
|
55
|
|
|
/** |
|
56
|
|
|
* App\Models\User. |
|
57
|
|
|
* |
|
58
|
|
|
* @property int $id |
|
59
|
|
|
* @property string $name |
|
60
|
|
|
* @property string $email |
|
61
|
|
|
* @property string $password |
|
62
|
|
|
* @property int $is_admin |
|
63
|
|
|
* @property string $remember_token |
|
64
|
|
|
* @property \Carbon\Carbon $created_at |
|
65
|
|
|
* @property \Carbon\Carbon $updated_at |
|
66
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Game[] $games |
|
67
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Logo[] $logo |
|
68
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\LogoVote[] $logovote |
|
69
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\Cmgmyr\Messenger\Models\Message[] $messages |
|
70
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\News[] $news |
|
71
|
|
|
* @property-read \Illuminate\Notifications\DatabaseNotificationCollection|\Illuminate\Notifications\DatabaseNotification[] $notifications |
|
72
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\Cmgmyr\Messenger\Models\Participant[] $participants |
|
73
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\UserRole[] $roles |
|
74
|
|
|
* @property-read \App\Models\UserSetting $settings |
|
75
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\Cmgmyr\Messenger\Models\Thread[] $threads |
|
76
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\UserList[] $userlists |
|
77
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\UserObyx[] $userobyx |
|
78
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\User whereCreatedAt($value) |
|
79
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\User whereEmail($value) |
|
80
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\User whereId($value) |
|
81
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\User whereIsAdmin($value) |
|
82
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\User whereName($value) |
|
83
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\User wherePassword($value) |
|
84
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\User whereRememberToken($value) |
|
85
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\User whereUpdatedAt($value) |
|
86
|
|
|
* @mixin \Eloquent |
|
87
|
|
|
* @property string $discord_user |
|
88
|
|
|
* @property string $discord_channel |
|
89
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\BoardPost[] $boardposts |
|
90
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\Venturecraft\Revisionable\Revision[] $revisionHistory |
|
91
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\User whereDiscordChannel($value) |
|
92
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\User whereDiscordUser($value) |
|
93
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Comment[] $comments |
|
94
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Shoutbox[] $shoutbox |
|
95
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Developer[] $developers |
|
96
|
|
|
* @property string|null $banned_at |
|
97
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\Cog\Laravel\Ban\Models\Ban[] $bans |
|
98
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\User whereBannedAt($value) |
|
99
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\User withRole($role) |
|
100
|
|
|
*/ |
|
101
|
|
|
class User extends Authenticatable implements BannableContract |
|
102
|
|
|
{ |
|
103
|
|
|
use \Venturecraft\Revisionable\RevisionableTrait; |
|
104
|
|
|
use Bannable; |
|
105
|
|
|
use CanResetPassword; |
|
106
|
|
|
|
|
107
|
|
|
/** |
|
108
|
|
|
* The attributes that are mass assignable. |
|
109
|
|
|
* |
|
110
|
|
|
* @var array |
|
111
|
|
|
*/ |
|
112
|
|
|
protected $fillable = [ |
|
113
|
|
|
'name', 'email', 'password', 'is_admin', |
|
114
|
|
|
]; |
|
115
|
|
|
|
|
116
|
|
|
use Notifiable; |
|
117
|
|
|
use EntrustUserTrait; |
|
118
|
|
|
use Messagable; |
|
119
|
|
|
/** |
|
120
|
|
|
* The attributes that should be hidden for arrays. |
|
121
|
|
|
* |
|
122
|
|
|
* @var array |
|
123
|
|
|
*/ |
|
124
|
|
|
protected $hidden = [ |
|
125
|
|
|
'password', 'remember_token', |
|
126
|
|
|
]; |
|
127
|
|
|
|
|
128
|
|
|
public static function boot() |
|
129
|
|
|
{ |
|
130
|
|
|
parent::boot(); |
|
131
|
|
|
} |
|
132
|
|
|
|
|
133
|
|
|
public function games() |
|
134
|
|
|
{ |
|
135
|
|
|
return $this->hasMany('App\Models\Game', 'user_id', 'id'); |
|
136
|
|
|
} |
|
137
|
|
|
|
|
138
|
|
|
public function news() |
|
139
|
|
|
{ |
|
140
|
|
|
return $this->belongsToMany('App\Models\News'); |
|
141
|
|
|
} |
|
142
|
|
|
|
|
143
|
|
|
public function settings() |
|
144
|
|
|
{ |
|
145
|
|
|
return $this->hasOne('App\Models\UserSetting', 'user_id', 'id'); |
|
146
|
|
|
} |
|
147
|
|
|
|
|
148
|
|
|
public function logo() |
|
149
|
|
|
{ |
|
150
|
|
|
return $this->hasMany('App\Models\Logo', 'user_id', 'id'); |
|
151
|
|
|
} |
|
152
|
|
|
|
|
153
|
|
|
public function logovote() |
|
154
|
|
|
{ |
|
155
|
|
|
return $this->belongsToMany('App\Models\LogoVote'); |
|
156
|
|
|
} |
|
157
|
|
|
|
|
158
|
|
|
public function userobyx() |
|
159
|
|
|
{ |
|
160
|
|
|
return $this->hasMany('App\Models\UserObyx', 'user_id', 'id'); |
|
161
|
|
|
} |
|
162
|
|
|
|
|
163
|
|
|
public function userlists() |
|
164
|
|
|
{ |
|
165
|
|
|
return $this->hasMany('App\Models\UserList', 'user_id', 'id'); |
|
166
|
|
|
} |
|
167
|
|
|
|
|
168
|
|
|
public function boardposts() |
|
169
|
|
|
{ |
|
170
|
|
|
return $this->hasMany('App\Models\BoardPost', 'user_id', 'id'); |
|
171
|
|
|
} |
|
172
|
|
|
|
|
173
|
|
|
public function comments() |
|
174
|
|
|
{ |
|
175
|
|
|
return $this->hasMany('App\Models\Comment', 'user_id', 'id'); |
|
176
|
|
|
} |
|
177
|
|
|
|
|
178
|
|
|
public function shoutbox() |
|
179
|
|
|
{ |
|
180
|
|
|
return $this->hasMany('App\Models\Shoutbox', 'user_id', 'id'); |
|
181
|
|
|
} |
|
182
|
|
|
|
|
183
|
|
|
public function developers() |
|
184
|
|
|
{ |
|
185
|
|
|
return $this->hasMany('App\Models\Developer', 'user_id', 'id'); |
|
186
|
|
|
} |
|
187
|
|
|
} |
|
188
|
|
|
|