Route::get('/users', [UserController::class, 'index']);
//In laravel 8 uncomment protected $namespace='AppHttpControllers';
public function boot()
{
...
Route::prefix('api')
->middleware('api')
->namespace('AppHttpControllers') // <---------
->group(base_path('routes/api.php'));
...
}
[PagesController::class, 'index']