Thursday, March 9, 2017

Laravel return integer value of id column

I have id column type (CHAR 7) of table PEOPLE like:

id       name               address
-------+------------------+---------
0010014  MUZZACHIODI FELIX  SAN MARTIN

My controller:

$people= People::find($id);

View return INTEGER:



How keep string id? I tried {!! $people->id !!} or (string)$people->id



via Alejandro Beltran

Advertisement