i'm trying to add a validation rule for composite unique in laravel 5.2. every thing worked fine.
'student_id' => 'unique_com:marks,exam_id,' . $data['exam_id']
but when i use it on array data i don't know how to pass the $data['exam_id']
'mark.*.student_id' => 'unique_com:marks,exam_id,(what i can pass here)'
or is there a way to access the validated data inside the extended validation rule.
note: exam_id
is the name of the second column in the database table marks,student_id and exam_id should be composite unique
.