I am trying to allow users to edit their playlist . However, whenever I try to execute a PATCH request, I get a MethodNotAllowedHttpException error message . (he is expecting a POST)
I installed RESTful Resource Controllers:
routes.php:
Route::resource('users', 'UsersController'); Route::resource('users.playlists', 'PlaylistsController');
This should give me access to: (as shown through php-artisan routes)
URI | Name | Action PATCH users/{users}/playlists/{playlists} | users.playlists.update | PlaylistsController@update
However, when I try to execute the following form, I get a MethodNotAllowedHttpException error:
/ users / testuser / playlists / 1 / change
{{ Form::open(['route' => ['users.playlists.update', $playlist->id], 'method' => 'PATCH' ]) }} {{ Form::text('title', $playlist->title) }} {{ Form::close() }}
If I remove 'method'=> 'PATCH' , I will not get an error, but it will execute my public function store() , and not my public function update()
source share