<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Payroll extends Model
{
    protected $fillable = ['user_id', 'pay_period_start', 'pay_period_end', 'basic_salary', 'allowances', 'deductions', 'tax', 'net_pay', 'status', 'paid_at', 'notes'];
    protected function casts(): array { return ['pay_period_start' => 'date', 'pay_period_end' => 'date', 'paid_at' => 'date', 'basic_salary' => 'decimal:2', 'allowances' => 'decimal:2', 'deductions' => 'decimal:2', 'tax' => 'decimal:2', 'net_pay' => 'decimal:2']; }
    public function user(){ return $this->belongsTo(User::class); }
}
