jeudi 2 mars 2017

how to create eloquent in laravel

i want to get name in the table cattegory, using model company

table company

id   -> primary key
name

table posting

id             -> primary key
id_posting_job -> foreign key
id_cattegory   -> foreign key
name

table cattegory

id    -> Primary Key
name

in my relation database

  1. id table company relation to id_posting_job in table posting
  2. id_cattegory table posting relation to id in table cattegory

what the eloquent for get data name in the cattegory, if access through model company ?

thank you



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire