jeudi 28 décembre 2017

laravel 5 save to databse and return id

laravel 5 im trying to use the eloquent save whilst returning the id of the tuple using

$var=$data->save(); then trying to return the primary key ... now my primary key is called company_id but when i run $id=$data->company_id.. it throws an error sayin column 'id'doesnt exist in the company table.

why does company_id get renamed to id.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire