Here is my controller:
in laravel-8 default remove namespace prefix so you can set old way in laravel-7 like:
in RouteServiceProvider.php
add this variable
protected $namespace = 'App\Http\Controllers';
and update boot
method
public function boot()
{
$this->configureRateLimiting();
$this->routes(function () {
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/web.php'));
Route::prefix('api')
->middleware('api')
->namespace($this->namespace)
->group(base_path('routes/api.php'));
});
}
In laravel-8 you can use like this
Route::group(['namespace'=>'App\Http\Controllers', 'prefix'=>'admin',
'as'=>'admin.','middleware'=>['auth:sanctum', 'verified']], function()
{
Route::resource('/dashboard', 'DashboardController')->only([
'index'
]);
});
Thanks