Target class does not exist.
composer dump-autoload//add controller path
Route::get('/players', 'App\Http\Controllers\PlayerController@index');Uncomment this line in app>>provider>>RouteServiceProvider.php file
// protected $namespace = 'App\\Http\\Controllers';use App\Http\Controllers\UserController;
Route::get('/users', [UserController::class, 'index']);
// or
Route::get('/users', 'App\Http\Controllers\UserController@index');
php composer dump-autoload
php artisan migrate:refresh --seed//accessing any function in the controller (this is web.php file)
use App\Http\Controllers\PostsController;
Route::get('/post', 'App\Http\Controllers\PostsController@index');