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

Project Samples

Project Activity

See All Activity >

Categories

Libraries

License

MIT License

Follow Laravel collection macros

Laravel collection macros Web Site

Other Useful Business Software
AI-generated apps that pass security review Icon
AI-generated apps that pass security review

Stop waiting on engineering. Build production-ready internal tools with AI—on your company data, in your cloud.

Retool lets you generate dashboards, admin panels, and workflows directly on your data. Type something like “Build me a revenue dashboard on my Stripe data” and get a working app with security, permissions, and compliance built in from day one. Whether on our cloud or self-hosted, create the internal software your team needs without compromising enterprise standards or control.
Try Retool free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Laravel collection macros!

Additional Project Details

Programming Language

PHP

Related Categories

PHP Libraries

Registered

2024-04-11