<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class EmployeeWithdrawal extends Model
{
    protected $fillable = [
        'employee_id',
        'amount',
        'reason',
        'created_by',
    ];

    protected $casts = [
        'employee_id' => 'int',
        'amount' => 'int',
        'created_by' => 'int',
    ];

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

    public function creator()
    {
        return $this->belongsTo(User::class, 'created_by');
    }
}
