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/UpdateVtcStudentCourseRequest.php

<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class UpdateVtcStudentCourseRequest extends FormRequest
{
    public function authorize(): bool
    {
        return auth()->guard('admin')->check();
    }

    public function rules(): array
    {
        return [
            'course_id' => [
                'required',
                'integer',
                'exists:courses,id',
            ],
            'vtc_student_id' => [
                'required',
                'integer',
                'exists:vtc_students,id',
            ],
        ];
    }

    public function messages(): array
    {
        return [
            'course_id.required' => 'Please select a course.',
            'course_id.exists'   => 'The selected course does not exist.',
            'vtc_student_id.required' => 'Please select a student.',
            'vtc_student_id.exists'   => 'The selected student does not exist.',
        ];
    }
}