jeudi 28 décembre 2017

Show the name of the other table by pivot table

The tables:

users

-id

-name

users_companies

-id

-user_id

-company_id

companies

-id

-name

users_companies is the pivot table

I want to show or get the "name" field of a table, this is my code in the table

<td></td>

but then it shows like this in the column of the table. I just want to get the value of the name like "VCY BT Holdings". Thanks

[{"id":5,"name":"VCY BT Holdings","deleted_at":null,"created_at":"2017-12-23 02:24:50","updated_at":"2017-12-23 02:24:50","pivot":{"user_id":14,"company_id":5}}] [enter image description here]1



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire