IMMREX7

aku nok ndi : /home/spdtg/www/schoolmis/app/Http/Requests/
File Up :
aku nok ndi : /home/spdtg/www/schoolmis/app/Http/Requests/StudentDocRequest.php

<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class StudentDocRequest extends FormRequest {

    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize() {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules() {
        $rules = [
            'idClass'=>'required',
            'idSection'=>'required',
            'idDocType'=>'required',
            'document'=>'required|mimes:pdf,jpg,jpeg,png,docx|max:10000',
            'idStudent'=>'required'
        ];
        return $rules;
    }

    public function messages() {
        $messages = [
            'idClass.required'=>'Class should be selected first.',
            'idSection.required'=>'Section must be selected.',
            'idStudent.required'=>'Select Enrollment No.',
            'idDocType.required'=>'Document Type must be selected.'
        ];
        return $messages;
    }

}

Copyright © 2021 - 2025 IMMREX7