"date", "join_date" => "date", ]; } protected function fullName(): Attribute { return Attribute::make( get: fn() => trim( implode(' ', array_filter([$this->first_name, $this->middle_name, $this->last_name])) ), ); } protected function photo(): Attribute { return Attribute::make( get: fn(string $value) => asset($value), ); } public function user(): BelongsTo { return $this->belongsTo(User::class, 'user_id'); } public function department() { return $this->belongsTo(Department::class, 'department_id'); } public function designation() { return $this->belongsTo(Designation::class, 'designation_id'); } public function branch() { return $this->belongsTo(Branch::class, 'branch_id'); } public function activityLogs() { return $this->hasManyThrough( ActivityLog::class, User::class, 'id', 'loggable_id' ) ->where('loggable_type', User::class); } protected static function newFactory(): EmployeeFactory { return EmployeeFactory::new(); } public static function getFillableFields() { return (new static())->getFillable(); } }