Неопределенная переменная: пользователь
Значения не обновляются ..
Файл ProfilesController.php ....
public function edit(User $user)
{
return view('profiles.edit',compact('user'));
}
public function update()
{
$data= request()->validate([
'title' =>'required',
'description'=>'required',
'url'=>'url',
'image'=>'',
]);
$user->profile->update($data);
return redirect("/profile/{$user->id}");
}
файл web.php ......
Route::get('/profile/{user}/edit', 'ProfilesController@edit')->name('profile.edit');
Route::patch('/profile/{user}', 'ProfilesController@update')->name('profile.update');