*/ protected $fillable = [ 'email', 'username', 'password', 'name', 'profile_picture', 'type', ]; /** * The attributes that should be hidden for serialization. * * @var array */ protected $hidden = [ 'password', 'remember_token', 'last_login_at', 'last_login_ip', 'user_agent', ]; /** * The attributes that are not mass assignable. * @var string[] */ protected $guarded = [ 'last_login_at', 'last_login_ip', 'user_agent', ]; /** * The attributes that should be cast. * * @var array */ protected $casts = [ 'email_verified_at' => 'datetime', ]; public function isOnboardingCompleted() { return true; } public function role(): ?HasOne { return match ($this->type) { UserType::ORGANIZER->value => $this->hasOne(Organizer::class), UserType::MANAGER->value => $this->hasOne(Manager::class), UserType::ARTIST->value => $this->hasOne(Artist::class), }; } public function offer_comments(): HasMany { return $this->hasMany(OfferComment::class, 'author_id'); } }