When I sent this command I got an error:

$ sail artisan route:list

Illuminate\Contracts\Container\BindingResolutionException 

Target class [app/Http/Controllers/API/AuthController] does not exist.

at vendor/laravel/framework/src/Illuminate/Container/Container.php:832

This is how my code looked like:

Route::post('/register', 'API/[email protected]');
Route::post('/login', 'API/[email protected]');
Route::apiResource('/ceo', 'API/CEOController')->middleware('auth:api');

Solution:

This is how it should look like:

Route::post('/register', [AuthController::class, 'register']);
// or
Route::post('/login', 'App\Http\Controllers\API\[email protected]');
// or
Route::apiResource('/ceo', 'App\Http\Controllers\API\CEOController')->middleware('auth:api');

For more help on this message, you can go to where I found the solution:

# NEW WAY LARAVEL 8
Source: https://stackoverflow.com/questions/63807930/target-class-controller-does-not-exist-laravel-8

Hope the helps: