I'm trying to develope a program with Laravel, I have a problem with a Route, it shows me that is not define but it's already defined, also, I'm using Ajax.
This is the Error
This is my Ajax with URL and Route And I tried to put the Route in that part of the code, but when I put there I get other problem.
I have tried this
Thank so much for your help.
CodePudding user response:
After adding new route you need to clear cache. So run this commands:
php artisan cache:clear
php artisan route:cache
And check again
CodePudding user response:
You have same controller method two time define and you did changed only route name? so it can return error. remove first route then it will work fine.
Route::post('schedule/destory', 'Client\SchedulesController@destory')->name('client.schedules.destory');
Route::post('schedule/destory', 'Client\SchedulesController@destory')->name('orders.schedules.store');
please remove Route::post('schedule/destory', 'Client\SchedulesController@destory')->name('client.schedules.destory');
route.