View source in the browser and look for the form tag..
Check the URL. It should end in the ID. Is that working?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I'm using laravel 5.3 and I keep getting an error saying undefined variable once I try and log in or click on edit profile. If I manually put "myapp.dev/profit/edit/1" in my browser it works but if I click on the edit profille link I'm only seeing "myapp.dev/profit/edit" in the URL. I've been at this for two days. Any help would be appreciated.
My routes:
Route::get('/profile/edit/{id}', 'ProfileController@getEdit');
Route::post('/profile/edit/{id}', 'ProfileController@postEdit');
My controller:
public function getEdit($id){
$user= User::findOrFail($id);
return view('profile.edit', compact('user'));
}
My view:
<li><a href="{{ url('/profile/edit', $user->id ) }}">Update profile</a></li>
My form:
{!! Form::model($user,['method' => 'POST', 'action'=>['ProfileController@postEdit', $user- >id]]) !!}
Please or to participate in this conversation.