samedi 24 février 2018

Laravel Eloquent Serialization

I have a table where the Primary Key looks like this: 123456-789 in column id. When I request all the entries from my table using $allArray = $this->all()->toArray() I have an issue. All the data arrives as expected but the id now looks like this: 123456789. The id column is set as varchar(24) utf8_general_ci in the database.

When I print_r() my result from $all = $this->all() (without ->toArray()) I can see that the id was fetched currently 123456-789. Then I try to get the id again like echo $all[1]->id it is 123456789.

Any help would be appreciated. Thank you :)



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2EZSIsO
via IFTTT

Aucun commentaire:

Enregistrer un commentaire