Kindly pardon me, I just started using Laravel Unique Rules
I have this table in Laravel-5.8:
exams: id, exam_category_id, exam_name, exam_year, student_id
Model class is Exam and the route in route list is exam
exam_category_id, exam_name, exam_year, student_id are uniquely tied together. Four of them are together
public function rules()
{
}
This is not working:
Rule::unique('exams', 'exam_category_id', 'exam_name', 'exam_year', 'student_id')
'exam_category_id' => [
'required',
Rule::unique('exams', 'exam_category_id', 'exam_name', 'exam_year', 'student_id')
],
Once you entered it, it won't allow any other student with the same ;'exam_category_id', 'exam_name', 'exam_year'
I have only used unique rule for one column. How can I make the four (4) columns to be unique together both for create and update?
Thank you.