sql - How can I return data from a foreign table when querying the USER in Laravel? -
for example, let's user table has column references foreign table height. if use:
return \auth::user()->height_id; in controller id of primary key referenced in height table, how can retrieve data that's inside referenced row in foreign table?
you should try
return \auth::user()->height()->your_height_table_field; this expected made relations between user , height model.
read more..
Comments
Post a Comment