<?php
namespace App\Models;

use App\Models\User;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class Employee extends Model
{
    protected $fillable = ['user_id','employee_code','full_name','email','phone','position','department','join_date','status'];
    protected $casts = ['join_date' => 'date'];
    public function user(): BelongsTo { return $this->belongsTo(User::class); }
    public function attendances(): HasMany { return $this->hasMany(Attendance::class); }
    public function leaves(): HasMany { return $this->hasMany(LeaveRequest::class); }
}
