Burhan Çelebi
Burhan Çelebi

Reputation: 99

How can i solve this error named Route [delete-blog] not defined in my blade file?

I have route name named delete-blog but i got error named Route Not Defined. I ran route:clear , cache:clear , config:cache and view:clear but that didn't work. I changed route name but i got this error again.

how can i solve this problem ? Can you help me?

My route code :

Route::get('haber/sil/{id}', 'BlogDeleteController')->middleware('auth.custom')->name('delete-blog');

Upvotes: 0

Views: 3596

Answers (2)

Burhan Çelebi
Burhan Çelebi

Reputation: 99

Thanks friend for your help. I solved this problem , like that :

My old route :

Route::get('haber/sil/{id}', 'BlogDeleteController')->middleware('auth.custom')->name('delete-blog');

My new route

Route::get('news/destroy/{id}', 'BlogDeleteController')->middleware('auth.custom')->name('delete-blog');

Upvotes: 0

Malkhazi Dartsmelidze
Malkhazi Dartsmelidze

Reputation: 4992

It is incorrect not to have function name in your route if you are not using resource Route but if you got Route not defined that is not the reason, otherwise you get Method not defined error.

Check if you have your Route in route group where you have 'as' => '[something]...' parameter.

Whatever reason it should be you must put function name in your route declaration:

 Route::get('haber/sil/{id}', 'BlogDeleteController@[Your delete Method Name Here]')->middleware('auth.custom')->name('delete-blog'); //put your function name

Upvotes: 1

Related Questions