Search

Showing 7 of 1,216 result(s)

/blog/2018/04/22/laravel-5-collections-filtering-collections-with-without-losing-filtered-rejections-partition#content-using-partition-with-higher-order-messages

The partition method can also be used with higher order messaging, which allows us to invoke collection methods and access object instance properties using PHP's property accessors syntax. In the reject section, we created a Product class that was...

/blog/2018/04/22/laravel-5-collections-getting-the-first-collection-element-with-first#content-signature

The following example shows how to get the first item in a collection: If the collection is empty (having no items), the first method will return null : The $default parameter cannot be used when trying to get the first item in an empty...

/blog/2018/04/22/laravel-5-collections-getting-the-first-collection-element-with-first#content-using-first-with-higher-order-messages

The first method can also be used with higher order messaging, which allows us to invoke collection methods and access object instance properties using PHP's property accessors syntax. In the reject section, we created a Product class that was...

/blog/2018/04/22/laravel-5-collections-grouping-collection-elements-with-groupby#content-signature

The following collection will be used throughout this section when demonstrating the groupBy method: The collection be grouped by the genus of each item like so: $genera = $collection->groupBy('genus'); The $genera variable will now be an instance...

/blog/2018/04/22/laravel-5-collections-grouping-collection-elements-with-groupby#content-preserving-keys-with-groupby

By default, the groupBy method will not preserve the keys in the underlying collection when grouping items. The following code sample shows how the groupBy method groups by default, and the output: The $grouped variable would now have a value...

/blog/2018/04/22/laravel-5-collections-mapping-collection-elements-and-reducing-to-a-single-dimension-with-flatmap#content-using-flatmap-with-higher-order-messages

The flatMap method can be used with higher order messaging, which allows us to invoke collection methods and access object instance properties using PHP's property accessors syntax. In the reject and partition sections, we created the following...

Some absolutely amazing
people

The following amazing people help support this site and my open source projects ♥️
If you're interesting in supporting my work and want to show up on this list, check out my GitHub Sponsors Profile.