Laravel 8 Target class [xxxxxxController] does not exist

原本是这么写的

Route::get('/index','IndexController@index');

Laravel 8 的话需要这么写,

use App\Http\Controllers\IndexController;

Route::get('/index', [IndexController::class, 'index']);

参考:

https://laravel.com/docs/8.x/routing#the-default-route-files