Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Laravel 8 'Route [admin.test] not defined'

I’m trying to write a new route, but it doesn’t work. Even this route is not shown in the route:list. But if i write route:cache, this route is working. It’s annoying for each new route, how to solve them ?

    Route::group(['prefix' => 'admin', 'middleware' => 'auth', 'as' => 'admin.'], function () {
        Route::get('/test', [AdminIndexController::class, 'index'])->name('test');  
});

in blade.php

<a href="{{ route('admin.test') }}">Test</a>

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

If you want to remove the routes cache , remove this file:

bootstrap/cache/routes.php

After that you can run artisan command

php artisan cache:clear

But There’s no problem about not using route cache. It just can make "your route registration up to 100x faster" as noted in the documentation.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading