dimanche 20 novembre 2022

Fetch product first based on values in column laravel

I have this query that fetches properties from table

$properties = Property::with('Category')
            ->orderBy('name','asc')
            ->where('status','Active')
            ->get();

In my table i have added new column featured it's value is either 0 or 1. I want to show property with 1 value in featured column first

Please suggest solution Thanks.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire