Support the ongoing development of Laravel.io →
posted 4 years ago
Last updated 2 years ago.
0

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

0

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,

Last updated 4 years ago.
0

And when I have this only route :

Route::post('customer', 'CustomerRestController@addOrUpdate')->name('api_customer_post');

I have a 405 error ..

0

please make sure the route exists, you can check list of all routes using this command:

$ php artisan route:list
0

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?

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.