1

I use laravel 9.25.1 and php 8.1.8. I have script $this->productId = $guest->products()->pluck('product_id')->toArray(); This script give me integer in localhost but it gives me string in hosting. I browsed everywhere to find the root cause and found in https://laracasts.com/discuss/channels/laravel/pluck-id-integer-cast-to-string that it seems bug in laravel 5 but still happens in laravel 9? Or is there anything I did wrong?

screenshot 1 screenshot 2

Muhammad Dyas Yaskur
  • 6,914
  • 10
  • 48
  • 73
Jonathan
  • 11
  • 4
  • Does this answer your question? [How do I return integer and numeric columns from MySQL as integers and numerics in PHP?](https://stackoverflow.com/questions/20079320/how-do-i-return-integer-and-numeric-columns-from-mysql-as-integers-and-numerics) – Ksi Aug 21 '22 at 06:49

0 Answers0