vendredi 11 décembre 2015

Laravel join three Table in single line

i have 3 table/Model such as Users, CurrentCurrency and CurrencyType, in CurrentCurrency 2 column are relation with CurrencyType and Users, as user_id and currency_id

i can use this code to fetch CurrentCurrency user :

$all_records = CurrentCurrency::with('user')->orderBy('id', 'DESC')->paginate(50);

this code return all records with users, now i can not get currency_id with this line, use both with('user') and with('currency_id') to get current record with user_id and currency_id



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire