Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

spAo's avatar
Level 1

Pivot table update

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...

0 likes
1 reply

Please or to participate in this conversation.