I have master skills table, and each authenticated user to add skill to their resume through the master skill table.
Now, the same skill should not be added again and again, I have the Laravel unique validations for same user. But this validation is not allowing different user even though they don’t have any skill in their resume.
public function SkillsAddFormValue(Request $request)
{
request()->validate([
'skill_id' => 'required|skill_id|unique:stu_resume_skills',
]);
$save = new StudentSkillsModel;
$save->user_id = Auth::user()->id;
$save->skill_id = $request->skill_id;
$save->expertise_level = $request->expertise_level;
$save->save();
return redirect('student/academics/resume/skills/skills-list');
}
DB Table
I tried writing the unique validation for it is not working.
New contributor
Mohan Palanisamy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.