*/ use HasFactory, HasRoles, Notifiable, SoftDeletes; /** * The attributes that are mass assignable. * * @var list */ protected $fillable = [ 'name', 'email', 'password', 'super_admin', 'app_verified_at', 'first_name', 'last_name', 'gender', 'company', 'uid', 'address', 'place', 'postcode', 'phone', ]; /** * The attributes that should be hidden for serialization. * * @var list */ protected $hidden = [ 'password', 'remember_token', ]; /** * Get the attributes that should be cast. * * @return array */ protected function casts(): array { return [ 'email_verified_at' => 'datetime', 'password' => 'hashed', 'app_verified_at' => 'datetime', ]; } public function canAccessPanel(Panel $panel): bool { Log::info('canAccessPanel'); return true; } public function canAccessAdminPanel(Panel $panel): bool { Log::info('canAccessAdminPanel'); if ($panel->getId() === 'admin') { return ( str_ends_with($this->email, '@webwerkstatt.tirol') || str_ends_with($this->email, '@kammerwest.at') ) && $this->hasVerifiedEmail(); } return false; } public function kammer() { return $this->belongsTo(Kammer::class); } public function bundesland() { return $this->belongsTo(Bundesland::class); } }