Laravel 'Route Not Defined' when route is clearly defined

When you use named route route then you have to specify routes name in your routes/web.php file. Like this

routes/web.php

Route::post('/register/basic/create', 'RegisterController@create')->name('register');

In blade file

<form method="POST" class="etc" action="{{ route('register') }}">
...
</form>

Check details here https://laravel.com/docs/5.6/routing#named-routes


There is a possibility that you cashed the route so clear route cashe

php artisan route:clear

if you still not finding your route After clearing cache, then remove the route and re-write your route with different keywords, hope you will find the problem


Sometimes the above error occurs when you have two routes with the same uri but different callbacks and different route name

For example

Route::post('update','PermissionController@update')->name('update_permission');`

Route::post('update','RoleController@update')->name('update_role');

The above routes update different resources but it will still return an error Route update_permission not defined or Route update_role not defined.

So the best thing to do is to use a different uri in each route so as to prevent conflict like this

Route::post('/role_permission/update','RoleController@update')->name('update_role');`

Route::post('/permission/update','PermissionController@update')->name('update_permission');