Harizon Cabigas
Harizon Cabigas

Reputation: 13

laravel eloquent remove the last zero on integer ending in zero

i have this table Info

ID | tel1 | tel2 |
1  | 080  | 0000 |

when i run Info::all(); the output is tel1 = 08, tel2 = 0,

i need to remain the zero at the end of the data;

my table structure

tel1 mediumint(3) unsigned zerofill
tel2 mediumint(4) unsigned zerofill

im using laravel

Upvotes: 0

Views: 304

Answers (1)

Aleksandrs
Aleksandrs

Reputation: 1509

If I understood correct those columns are phone numbers. Also if its number it could contain in future some '+' sign or '(' and ')'. Try to store them better as VARCHAR instead of Integers.

Upvotes: 1

Related Questions