Illuminate\Contracts\Container\BindingResolutionException Target class [StockController] does not exist. code example

Example 1: Illuminate\Contracts\Container\BindingResolutionException target calss does not exist

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: Illuminate\Contracts\Container\BindingResolutionException Target class [PagesController] does not exist.

Target class [PagesController] does not exist.

Tags:

Misc Example