Reputation: 35
I'm having this error occur:
Route [/update] not defined. (View: C:\Server\nginx-1.13.1\html\developer\resources\views\profile.blade.php)"
For this route:
Route::post('/update', 'ProfileController@update');
and this view:
<form class=card method=POST action={{ route('/update') }}>
Upvotes: 1
Views: 1103
Reputation: 13669
in your web.php , you should give name to your route , then you can access that route by name in blade
Route::post('/update', 'ProfileController@update')->name('update');
in your blade template
<form class=card method=POST action={{ route('update') }}>
Upvotes: 0
Reputation: 135
or you can just change route
to url
or asset
like this
<form class=card method=POST action={{ url('/update') }}>
Upvotes: 0
Reputation: 3525
the route() method takes the name not the path
Route::post('/update', ['as' => 'my-update', 'uses' => 'ProfileController@update']);
then call route('my-update')
Upvotes: 2