-
Couldn't load subscription status.
- Fork 11.6k
Description
I stumbled upon this weird behavior when testing route caching. If I have a routes file containing only the following routes:
Route::get('home', 'WelcomeController@index');
Route::get('home', 'HomeController@index');
Running artisan route:cache throws exception:
exception 'Exception' with message 'Serialization of 'Closure' is not allowed' in ..\vendor\laravel\framework\src\Illuminate\Foundation\Console\RouteCacheCommand.php:95
After carefully inspecting the RouteCollection passed to the buildRouteCacheFile() function in the RouteCacheCommand.php, I see no indication that there are any closures in the collection.
I realize it's silly to define the 'home' route twice pointing to different controllers, but it seems like the wrong exception is being thrown in the above case.