Reputation: 411
i'm trying to query my mysql database with eloquent laravel but it doesn't work.
User::where('id', 1)->first()
however when i try with sql query it works.
DB::table('users')->first()
thanks in advance.
Upvotes: 1
Views: 304
Reputation: 1977
May be you didn't use your User namespace. If not, use your User model namespace in controller.
Upvotes: 1