Search code examples
laravellaravel-5dompdf

Laravel Dompdf Show Blank When Display Specific Data


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?


Solution

  • 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();