*/ protected $fillable = [ 'name', 'username', 'email', 'password', 'company_id', 'department_id', 'role_id', 'created_by', 'gender', 'address', 'phone', 'status', ]; /** * 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 = [ 'email_verified_at' => 'datetime', 'password' => 'hashed', ]; protected function superAdmin(): Attribute { return Attribute::make( get: fn() => $this->role_id == config("auth.super_admin_role_id"), ); } public function guardName(): string { return $this->guard_name; } public function company(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(Company::class); } public function role(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(Role::class); } public function createdBy(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(User::class, 'created_by'); } public function department(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(Department::class); } }