<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class AttendanceRecord extends Model
{
    protected $fillable = ['user_id', 'work_date', 'clock_in_at', 'clock_out_at', 'status', 'notes', 'approved_by'];
    protected function casts(): array { return ['work_date' => 'date', 'clock_in_at' => 'datetime', 'clock_out_at' => 'datetime']; }
    public function user(){ return $this->belongsTo(User::class); }
    public function approver(){ return $this->belongsTo(User::class, 'approved_by'); }
}
