Login
From:
freek.dev
(Uncensored)
subscribe
Do not call toArray() to get all items from a Laravel Collection - Freek Van der Herten's blog on PHP, Laravel and JavaScript
https://freek.dev/2861-do-not-call-toarray-to-get-all-items-from-a-laravel-collection
links
backlinks
Roast topics
Find topics
Find it!
Something that you’ll need to often is casting the collection back to a regular array. Like me, you might be tempted to use toArray() for this. But that might be the wrong method to call.