Collections
Collections are a thin wrapper around arrays that make them much easier to work with.
Last updated
Collections are a thin wrapper around arrays that make them much easier to work with.
Last updated
You can create a collection in a couple of ways:
If you are used to working with arrays, you can continue using them in the same way.
However, collections come with a huge assortment of handy functions that can make your life easier.
The collection class that Lumberjack uses comes from Laravel,
For a list of the available methods, please refer to their documentation:
Similar to post types and the query builder, you can add your own methods to the collection class using macros. For more information about this, please refer to Laravel's documentation: