Target class [controller] does not exist - Laravel 8 (Error Solved)

You are using Laravel 8. In a fresh install of Laravel 8, there is no namespace prefix being applied to your route groups that your routes are loaded into.



"In previous releases of Laravel, the RouteServiceProvider contained a $namespace property. This property's value would automatically be prefixed onto controller route definitions and calls to the action helper / URL::action method. In Laravel 8.x, this property is null by default. This means that no automatic namespace prefixing will be done by Laravel." Laravel 8.x Docs - Release Notes

Problem :

In Laravel 8, if you define route like this:


You'll get this error:

Solution :

You would have to use the Fully Qualified Class Name for your Controllers when referring to them in your routes when not using the namespace prefixing.


Now you can see error is solved:


Enjoy your project in Laravel 8, If you have any problem feel free to ask in comment section. Thank You!


Post a Comment

0 Comments