laravel route target class not found code example

Example 1: laravel route target class not found

Routing namespaces have been updated on Laravel 8.X

On your router, you should define:
use App\Http\Controllers\TestController;

And then, declare:
Route::get('test',[TestController::class, 'test']);

Example 2: laravel route target class not found

Routing namespaces have been updated on Laravel 8.X

On your router, you should define:
use App\Http\Controllers\TestController;

And then, declare:
Route::get('test',[TestController::class, 'test']);

Tags:

Misc Example