<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Leave extends Model
{
    protected $fillable = [
        'user_id',
        'employee_id',
        'leave_type',
        'is_paid',
        'leave_date',
        'leave_time',
        'leave_time_from',
        'leave_time_to',
        'reason',
        'status',
    ];

    protected $casts = [
        'user_id' => 'int',
        'employee_id' => 'int',
        'leave_date' => 'date',
        'is_paid' => 'boolean',
    ];

    public function user()
    {
        return $this->belongsTo(User::class);
    }

    public function employee()
    {
        return $this->belongsTo(Employee::class);
    }
}
