abdulrafey38
1 month ago
146
2
Laravel

Validations

Posted 1 month ago by abdulrafey38

I want to put a validation where combination of three columns (section_id, course_id, faculty_id) if repeated is not allowed, how to acheive it.


        $validate = Validator::make($request->all(), [
            'section_id' => 'required',
            'course_id' => 'required',
            'faculty_id' => 'required',


        ], [
            'section_id.required' => 'Please select the Section.',
            'course_id.required'  => 'Please select the Course.',
            'faculty_id.required' => 'Please select Faculty.',
            'u_id.unique'   => 'Teacher Already Assign to Same Section!!'


        ]);
        if ($validate->fails()) {
            return redirect()
                ->back()->withErrors($validate)->withInput();
        }

Please sign in or create an account to participate in this conversation.