<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class PaymentRequest extends FormRequest
{
    public function authorize()
    {
        return auth()->check();
    }

    public function rules()
    {
        return [
            'laborer_id' => 'required|exists:laborers,id',
            'timesheet_id' => 'nullable|exists:timesheets,id',
            'amount' => 'required|numeric|min:0',
            'method' => 'nullable|string|max:100',
            'paid_at' => 'nullable|date',
            'notes' => 'nullable|string',
        ];
    }
}