xxxxxxxxxx
Uncomment "protected $namespace = 'App\\Http\\Controllers';" line in "RouteServiceProvider.php" file and you should be good.
xxxxxxxxxx
use App\Http\Controllers\UserController;
//this is for admin controllers like this
use App\Http\Controllers\Admin\UserController;
xxxxxxxxxx
public function boot()
{
Route::prefix('api')
->middleware('api')
->namespace('App\Http\Controllers') // <---------
->group(base_path('routes/api.php'));
}