I have a problem and can't find a working solution. I hope this is easy to fix. I am using a database "id" that is not auto incremented but is unique. Every number in the column is 10 digits but many have a leading zero i.e. 0987654321. When I return the "id" to display it, I lose the leading zero i.e. 987654321. I am trying to use the full number 0987654321 in the URI to display the correct page - /path/to/0987654321 but I get /path/to/987654321.
I am using the "compact('xxx') function to send it to the view, but I don't know if that is effecting it.
Any suggestions?
My problem is that I was doing this in a LiveWire Datatables where one of my columns contained zipcodes. Well not all zip codes have a leading zero. So prepending it would mess up the rest of the data. ohffs trick worked by adding a call back column and adjusting the size to 5 instead of 10. Now zipcode 501 in Suffolk NY is 00501. Thanks for the hint.
@donb If it’s an integer column, then you’ll lose the leading zeroes because an integer value can’t begin with a zero. You’ll need to make it a string type instead if the leading zeroes are significant.