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).



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire