I just upgraded from Laravel 6 to 8 and now I am getting the following error when running php artisan optimize:
Unable to prepare route [post] for serialization. Another route has already been assigned name [post.index].
Here is what my web.php file looks like:
$Routes = function() {
Route::get('/about', 'SinglePageController@about');
Route::post('login', 'AuthLoginController@login');
Route::resource('/post', 'PostController');
};
Route::group(['middleware' => 'impersonate','domain' => '127.0.0.1'], $Routes);
Route::group(['middleware' => 'impersonate','domain' => '127.0.0.2'], $Routes);
If I comment out the Route::resource or one of the Route::group lines it works with the limited functionality.
question from:https://stackoverflow.com/questions/65946417/unable-to-prepare-route-after-upgrading-from-laravel-6-to-8