Reputation: 211
When I use this query:
$admin = \App\Admin::all();
It works.
But when I use this query:
$admin = \App\Admin::where('status', "ACTIVE");
Its shows blank! Even though when I use this query to show data at blade file, it's works!
Why?
Upvotes: 1
Views: 74
Reputation: 5270
You have to use like this If you want multiple result
$admin = \App\Admin::where('status', "ACTIVE")->get();
Or if you want a single result then use this
$admin = \App\Admin::where('status', "ACTIVE")->first();
Upvotes: 1