vendredi 30 novembre 2018

How to return collection instead array from DB Laravel?

If to use basic queries using use Illuminate\Support\Facades\DB; we get result as array instead collection. How to return collection?

$users = DB::select('select * from users where active = ?', [1]);

It returns array of $users (rows).



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

Aucun commentaire:

Enregistrer un commentaire