Answer the question
In order to leave comments, you need to log in
Why doesn't the save() method work on related models?
Did according to the documentation
public function update(Request $request, $id)
{
User::find($request->user_id)->roles()->save(['role_id' =>$request->role_id]);
{
Session::flash('store', 'Привелегия успешна добавлена!');
return redirect()->route('users.index');
}
}
Answer the question
In order to leave comments, you need to log in
Because argument 1 to Illuminate\Database\Eloquent\Realtions\BelongsToMany::save() must be an instance of Illuminate\Database\Eloquent\Model, but an array given.
Always happy to help, no thanks.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question