5 use Illuminate\Database\Eloquent\Factories\HasFactory;
6 use Illuminate\Foundation\Auth\User as Authenticatable;
7 use Illuminate\Notifications\Notifiable;
8 use Laravel\Sanctum\HasApiTokens;
11 class User extends Authenticatable
13 use HasApiTokens, HasFactory, Notifiable;
15 public function isParticipant(Tournament $tournament) {
16 foreach ($tournament->participants as $participant) {
17 if ($participant->user->id == $this->id) {
24 public function participation() {
25 return $this->hasMany(Participant::class);
29 * The attributes that are mass assignable.
33 protected $fillable = [
47 * The attributes that should be hidden for serialization.
59 * The attributes that should be cast.
65 'username' => 'string',
66 'discriminator' => 'string',
69 'verified' => 'boolean',
71 'mfa_enabled' => 'boolean',
72 'refresh_token' => 'encrypted',