'exam_category_id' => Rule::unique('exams')->where(function ($query) use ($request) { return $query->where('exam_name', $request->exam_name) ->where('exam_year', $request->exam_year) ->where('student_id', $request->student_id); })