mardi 7 février 2017

Laravel 5 Can't Use User Class

I'm new to Laravel. I just installed Laravel 5 and have been going through some video tutorials in order to learn how it works.

I want to use the User class as it seems like it is very useful. In my web.php (routes) file, I have:

use app\Models\User;      

Route::get('/users', function (){
        $users = User::all(); //select * from users
        return $users;
      });

I get the following error upon loading that route in my browser:

enter image description here

I have a User.php file placed in my app/Models/ directory, and also changed in my auth.php file for it to reference this.

There are countless questions like this online and I try the fixes but I can't seem to get it to work. Any ideas?

Thanks!



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2kJWgoO
via IFTTT

Aucun commentaire:

Enregistrer un commentaire