'date:Y-m-d', 'check_in_at' => 'datetime', 'check_out_at' => 'datetime', 'check_in_latitude' => 'decimal:7', 'check_in_longitude' => 'decimal:7', 'check_out_latitude' => 'decimal:7', 'check_out_longitude' => 'decimal:7', 'work_duration_minutes' => 'integer', ]; } public function getActivitylogOptions(): LogOptions { return LogOptions::defaults() ->logAll() ->logOnlyDirty() ->dontLogEmptyChanges(); } protected function formattedAttendanceDate(): Attribute { return Attribute::make( get: fn () => $this->attendance_date?->translatedFormat('l, d F Y'), ); } protected function formattedCheckInAt(): Attribute { return Attribute::make( get: fn () => $this->check_in_at?->translatedFormat('l, d F Y H:i'), ); } protected function formattedCheckOutAt(): Attribute { return Attribute::make( get: fn () => $this->check_out_at?->translatedFormat('l, d F Y H:i'), ); } public function employee(): BelongsTo { return $this->belongsTo(Employee::class); } public function payrollAdjustments(): HasMany { return $this->hasMany(PayrollAdjustment::class); } public function registerMediaCollections(): void { $this->addMediaCollection('checkin'); $this->addMediaCollection('checkout'); } public function registerMediaConversions(?Media $media = null): void { $this->addMediaConversion('thumb') ->fit(Fit::Contain, 150, 150); } }