*/ use HasFactory, Notifiable; public function isAdmin(): bool { return in_array($this->role, ['admin', 'super_admin', 'gestionnaire_rh']); } public function isSuperAdmin(): bool { return $this->role === 'super_admin'; } public function isGestionnaireRH(): bool { return $this->role === 'gestionnaire_rh'; } public function isCandidate(): bool { return $this->role === 'candidate'; } public function candidate() { return $this->hasOne(Candidate::class); } public function tenant() { return $this->belongsTo(Tenant::class); } public function securityAlerts() { return $this->hasMany(SecurityAlert::class); } /** * Get the attributes that should be cast. * * @return array */ protected function casts(): array { return [ 'email_verified_at' => 'datetime', 'password' => 'hashed', ]; } }