-2

I am trying to load up a view, as simple as that. I don't know where to go I using composer dump-autoload that it was an issue with loading the controller however it didn't help. The pictures show the project filesRoutes file

Controller

View

Error

I'm hoping to get some help!

  • Does this answer your question? [Target class controller does not exist - Laravel 8](https://stackoverflow.com/questions/63807930/target-class-controller-does-not-exist-laravel-8) – steven7mwesigwa Mar 20 '21 at 21:42

1 Answers1

0

If you are using laravel 8 you should pass controllers in routes in new way. This syntax which you try is the old one. Check this..

use App\Http\Controllers\UserController;

Route::get('/users', [UserController::class, 'index']);

Also you should follow convention and name your controllers in singluar form. user not users. Let me know if it helped.

Kishieel
  • 1,811
  • 2
  • 10
  • 19