*/ protected $fillable = [ 'phone', 'role', 'first_name', 'last_name', 'profile_image', 'birth_date', 'id_image', 'is_approved', 'password', // We'll still use password for authentication ]; /** * The attributes that should be hidden for serialization. * * @var array */ protected $hidden = [ 'password', 'remember_token', ]; /** * The attributes that should be cast. * * @var array */ protected $casts = [ 'birth_date' => 'date', 'is_approved' => 'boolean', 'approved_at' => 'datetime', ]; /** * Get the user's full name */ public function getFullNameAttribute() { return "{$this->first_name} {$this->last_name}"; } /** * Check if user is a tenant */ public function isTenant() { return $this->role === 'tenant'; } /** * Check if user is an owner */ public function isOwner() { return $this->role === 'owner'; } /** * Check if user is an admin */ public function isAdmin() { return $this->role === 'admin'; } /** * Check if user is approved */ public function isApproved() { return $this->is_approved; } }