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

You can cannot cache routes that use Closure's.

"If your application is exclusively using controller routes, you may take advantage of Laravel's route cache.".

You must have already cached your routes then added a new one with a Closure which would give you that error when you go to clear the route cache to generate a new one.

You can do the following though:

Route::group(['prefix' => 'admin'], function() {
    Route::get('/', 'MyController@index');
});
Last updated 9 years ago.
0

Thanks

I wouldn't have thought of looking under controllers for that information.

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.