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.
PHP
Eloquent Query Classes Pattern
Learn how to use Eloquent Query Classes to organize important database logic in Laravel without adding a full repository layer. Read more