-4

im working with laravel in a crud project and i have to create the route for a controller but i keep getting this error: Class "StudentController" does not exist enter image description here

The thing is it does exist and its locate in the correct location, what can i do to fix it?

enter image description here

Antonio
  • 23
  • 5
  • 2
    If you read the [documentation](https://laravel.com/docs/10.x/controllers#resource-controllers), you will see you have to use `StudentController::class`, not `'StudentContoller'`... – matiaslauriti Mar 05 '23 at 21:20

1 Answers1

3

the way you use it is wrong. you have to import the namespace of the controller not just the name of the controller.

Route::resource('student', StudentController::class);

change your code like so. this should fix the issue

matiaslauriti
  • 7,065
  • 4
  • 31
  • 43
arya_la
  • 399
  • 2
  • 10