When I clear caches in my Laravel 5.2 project, I see this error message:
[LogicException] Unable to prepare route [panel] for serialization. Uses Closure.
the solustion when we use routes like this:
Route::get('/', function () { return view('welcome'); });
laravel call them Closure so you cant optimize routes uses as Closures you must route to controller to use php artisan optimize
php artisan optimize