'date', 'resign_date' => 'date', 'employment_status' => EmploymentStatus::class, 'base_salary' => 'integer', ]; } public function fullTime(Builder $query): void { $query->where('employment_status', EmploymentStatus::FULL_TIME->value); } #[Scope] public function partTime(Builder $query): void { $query->where('employment_status', EmploymentStatus::PART_TIME->value); } #[Scope] public function contract(Builder $query): void { $query->where('employment_status', EmploymentStatus::CONTRACT->value); } #[Scope] public function temporary(Builder $query): void { $query->where('employment_status', EmploymentStatus::TEMPORARY->value); } public function baseSalaryFormatted(): Attribute { return Attribute::make( get: fn () => 'Rp '.number_format($this->base_salary, 0, ',', '.'), ); } public function joinDateFormatted(): Attribute { return Attribute::make( get: fn () => Carbon::parse($this->join_date)->format('l, d F Y'), ); } public function resignDateFormatted(): Attribute { return Attribute::make( get: fn () => $this->resign_date ? Carbon::parse($this->resign_date)->format('l, d F Y') : null, ); } public function joinDateInput(): Attribute { return Attribute::make( get: fn () => $this->join_date?->format('Y-m-d'), ); } public function employmentStatusLabel(): Attribute { return Attribute::make( get: fn () => $this->employment_status?->label(), ); } public function user(): BelongsTo { return $this->belongsTo(User::class); } }