xxxxxxxxxx
[PagesController::class, 'index']
xxxxxxxxxx
public function boot()
{
Route::prefix('api')
->middleware('api')
->namespace('App\Http\Controllers') // <---------
->group(base_path('routes/api.php'));
}
xxxxxxxxxx
Kindly Follow the below link:
https://www.scratchcode.io/laravel-8-target-class-controller-does-not-exist/
xxxxxxxxxx
Uncomment "protected $namespace = 'App\\Http\\Controllers';" line in "RouteServiceProvider.php" file and you should be good.