}
+ public function hasGlobalRole($name) {
+ return !empty($this->global_roles) && in_array($name, $this->global_roles);
+ }
+
public function isAdmin() {
return $this->role === 'admin';
}
+ public function isPrivileged() {
+ return $this->role === 'special' || $this->isAdmin();
+ }
+
public function isApplicant(Tournament $tournament) {
foreach ($tournament->applications as $applicant) {
if ($applicant->user_id == $this->id) {
}
+ public function channel_crews() {
+ return $this->hasMany(ChannelCrew::class);
+ }
+
public function participation() {
return $this->hasMany(Participant::class);
}
protected $fillable = [
'id',
'username',
+ 'discord_nickname',
'discriminator',
'email',
'avatar',
'discriminator' => 'string',
'email' => 'string',
'avatar' => 'string',
- 'avatar_cached' => 'boolean',
+ 'avatar_cached' => 'datetime',
'verified' => 'boolean',
+ 'global_roles' => 'array',
'locale' => 'string',
'mfa_enabled' => 'boolean',
'refresh_token' => 'encrypted',