Laravel's collection class is truly wonderful. It contains a lot of handy methods and you can create some very elegant code with it. In client projects I found myself adding the same macro's over and over again. That's why my colleague Seb and I took some time to create a package aptly called Laravel-collection-macros that contains those macros.
Features
- Pass a second parameter to be used as a fallback
- Retrieve item at the second index
- Documentation available
- Pass a second parameter to be used as a fallback
- Chunks the values from a collection into groups as long the given callback is true
- Create a Paginator instance for the items in the collection
Categories
LibrariesLicense
MIT LicenseFollow Laravel collection macros
Other Useful Business Software
Our Free Plans just got better! | Auth0
You asked, we delivered! Auth0 is excited to expand our Free and Paid plans to include more options so you can focus on building, deploying, and scaling applications without having to worry about your security. Auth0 now, thank yourself later.
Rate This Project
Login To Rate This Project
User Reviews
Be the first to post a review of Laravel collection macros!