samedi 24 août 2019

Order products table according to a column in users table [laravel]

I have two tables in the database Products and Users

I have this SQL query

Product::where('status',5)->where('user_id',120)->orderBy('created_at','DESC')->paginate(50)

and I have a column in USERS table called valid_rate

all i need is to order those products by valid_rate column in the users table

to be like that Product::where('status',5)->orderBy('valid_rate','DESC')->get();



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

Aucun commentaire:

Enregistrer un commentaire