1
votes

usually when I want to create controller I use php artisan

php artisan make:controller UserController

but in this case I have error in my terminal

[Symfony\Component\Debug\Exception\FatalThrowableError]

Class 'User' not found

and I wanna use it for users page - update and display users, as well as route

Route::resource('/user', 'UserController');

should I use it like that or something else? and why do I get error?

1
Did you made by any chance the command php artisan make:auth before that?GabMic
It's really not been created? your command seems okay to me, did you try doing that to other laravel project?Beginner
its fine, I wrote it in answer, controllers should have s at and in my case UsersController and not UserControllerNight5talker

1 Answers

0
votes

You get this error because you've used User class somewhere in the code (some controller probably). Find out where did you used it and add this clause to the top of that class:

use App\User;

Or just use full namespace, for example:

\App\User::get();