باسلام
موقع ویرایش کاربر این ارور رو بهم نمایش می دهد :
Symfony\Component\Debug\Exception\FatalThrowableError
Call to a member function with() on null
کد کنترولر :
public function edit($id)
{
$roles = Role::all();
$user = User::where('id', $id)->with('roles')->first();
return view("management.users.edit")->withUser($user)->withRoles($roles);
}@mnamazi
به جای where از find استفاده کنید.
public function edit($id)
{
$roles = Role::all();
$user = User::find($id)->with('roles')->first();
return view("management.users.edit", compact('roles', 'user'));
}شاید پاسخ شما همینجا باشد