jeudi 15 septembre 2016

How can i display a table with two foreign keys in laravel

I have 3 tables

Users
-------------
user_id  (PK)
user_name

Items_distributed
-------------
user_id (FK) 
item_id(FK)

Item List
-----------------
item_id(PK)
item_name

Now i need to print Items_distributed table by taking both the user_id and item_id and dispaly their item_name and user_name

i dont know how to display both things at a time if i display either item_name or user_name its working but when i try to print both it is not working . Can any one solve my problem .



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire