Laravel Collections Chains: 15 Real Examples
Collections in Laravel are "hidden gems": everyone has heard of them, but not everyone is...
We found 13 results for "collections".
Collections in Laravel are "hidden gems": everyone has heard of them, but not everyone is...
In this tutorial, we will create a simple search from three Models and will use Laravel Collections to combine them into one collection to show results in the front-end.
Laravel Eloquent is awesome - probably I don't need to tell you that. What is less known is the list of methods to work with Eloquent Collections. You can filter them, slice them, easily modify etc. But let's look at it one by one.
In this short tutorial, we will see three examples of the Collections method pluck(). I think it is rarely used and should be used more often.
I demonstrate how to perform a search in multiple Eloquent models, in two ways: with local "like" search, and then with external tools like Laravel Scout and Algolia driver.
Presenting my new online course, and three examples from that course.
Laravel and Eloquent Collections allow you to combine and chain operations into a shorter one-sentence block. Let's take a look at some examples of map(), mapWithKeys(), each(), filter() and push() methods.
A set of useful Laravel collection macros
I want to raise a discussion. Laravel Collections allow you to avoid writing loops, also chaining the methods to make the code shorter. But is it really better or more readable? Let's discuss this.
A small experiment based on one small report with grouped data. Is it worth using Eloquent Collections for grouping, or is it better to leave it to the database level?
People say that Laravel Collections operations are slower than arrays. But by how much? Is the difference significant? Let me show you an example and share my thoughts.
A practical example of timezones transformed into a Collection suitable for Filament dropdown select.