Your IP : 216.73.216.91


Current Path : /var/www/html/LLCF-APP/app/Http/Requests/
Upload File :
Current File : /var/www/html/LLCF-APP/app/Http/Requests/UpdateStudentRequest.php

<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class UpdateStudentRequest extends FormRequest
{
    public function authorize(): bool
    {
        return true;
    }

    public function rules(): array
    {
        $id = $this->route('id');

        return [
            'stu_full_name' => 'required|string|min:3|max:255',
            'stu_dob' => 'nullable|date|before_or_equal:today',
            'stu_gender' => 'required|string|max:10',
            'gr_num' => 'required|integer|unique:student,gr_num,' . $id,
            'auto_gr_num' => 'required|string|max:45|unique:student,auto_gr_num,' . $id,
            'class' => 'required|string|max:45',
            'family_id' => 'required|exists:family,id',
            'donor_id' => 'nullable|exists:donor,id',
            'donation_date' => 'nullable|date',
            'donation_expiry' => 'nullable|date|after_or_equal:donation_date',
        ];
    }
}