Level 75
Everything is described in the documentation
https://laravel.com/docs/8.x/eloquent-relationships#updating-a-record-on-the-intermediate-table
https://laravel.com/docs/8.x/eloquent-relationships#many-to-many
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello i have brackets table and students table and pivot table student_bracket and in this student_bracket table i have field called number so when i add student and bracket in student_bracket table then i must added number randomly but i my controller don't works
public function editStudentToBracket(Request $request, $id)
{
$studBrackNumb = $request->get('number');
$numberUpdate = BracketStudent::where('id', $id)->update(['number' => $studBrackNumb]);
return response()->json([
"numberUpdate" => $numberUpdate,
]);
}
Too few arguments to function error...
Please or to participate in this conversation.