Why is production from the database it returns a string and not a number?

Use larabel, I have table in database with fields int and returns type int
It is on the local machine. But when I do the same on the production server returns the row and because of this many breaks in the program.

PS our database there if you look at the value of all fields as int

5e1346746bcaa445463352.jpeg

Here is the code receiving records from a database
$promocode = Promocode::where('code', '=', $code)->first();
dd($promocode);


Here is the answer on the local server
5e134ab13a4e7615907629.jpeg

Here is the answer in production
5e134ac51d2b7071100488.jpeg
April 4th 20 at 00:56
2 answers
April 4th 20 at 00:58
Solution
To get the numbers you need to comply with several conditions

- mysqlnd driver is installed
- disable emulation of prepared statements in PDO
- use the prepared query.
April 4th 20 at 01:00
If there is no possibility to change server settings, which is important in the case of virtual hosting, the problem can be solved by setting the casts in the model. Googly Laravel model casting attributes
Already did so) - Penelope98 commented on April 4th 20 at 01:03

Find more questions by tags PHP