Change the order of the routes. First the ones without the variable and then with the variable. And remove the / in the ones that dont have variables
Hi Rodrigo,
Thanks for your answer, but it still doesnt work.
I have these routes :
Route::delete('customer/{id}', 'CustomerRestController@delete')->name('api_customer_delete');
Route::get('customer/{id}', 'CustomerRestController@get')->name('api_customer_get');
Route::post('customer', 'CustomerRestController@addOrUpdate')->name('api_customer_post');
Route::get('customer', 'CustomerRestController@all')->name('api_customer_all');
But when I call the POST, the get is executed ! Why the method is not recognized ?
Thanks,
And when I have this only route :
Route::post('customer', 'CustomerRestController@addOrUpdate')->name('api_customer_post');
I have a 405 error ..
please make sure the route exists, you can check list of all routes using this command:
$ php artisan route:list
first of all... from where you are telling the browset that you have a post method? are you sure that the posting method is given?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.