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
Go from Data Warehouse to Data and AI platform with BigQuery Icon
Go from Data Warehouse to Data and AI platform with BigQuery

Build, train, and run ML models with simple SQL. Automate data prep, analysis, and predictions with built-in AI assistance from Gemini.

BigQuery is more than a data warehouse—it's an autonomous data-to-AI platform. Use familiar SQL to train ML models, run time-series forecasts, and generate AI-powered insights with native Gemini integration. Built-in agents handle data engineering and data science workflows automatically. Get $300 in free credit, query 1 TB, and store 10 GB free monthly.
Try BigQuery 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