lundi 24 août 2015

Filter Pivot table conditionally with inverse relation - Laravel 5

I have roomConfigurations table like bellow,

id
roomTypeID
hotelId

Then Hotels table is like this

id
hotelNeme

Then Users table like this

id
userId
userName
passwd

Then hotel_user (Pivot) table like this

id
user_id
hotel_id

Now my question is, How can i get all records from roomConfigurations table for selected user ?

I can do this using MySQL by joining tables, But i dont have any idea to do this in Laravel 5.

I would be very appreciate, if anyone can help me on this. Thanks



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1h9cJNr
via IFTTT

Aucun commentaire:

Enregistrer un commentaire