samedi 22 février 2020

Laravel Eloquent Join Using Another table

Hi how to convert this SQL query to Laravel Eloquent?
I have three table: payments, devices and users. Payments table does not store user_id. but table has device_id. And device table also has user_id.
I want to get user name which made payment.

select * from payments p 
join devices d on p.device_id = d.devid
join users u on d.user_id = u.id


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire