In "Laravel 5"

Laravel 5 Collections: Adding an Element to the End of a Collection With push

The push method is the logical opposite of the prepend method and will push an item onto the end of the collection. The push method returns a reference to the original collection instance. The push method...

Laravel 5 Collections: Adding Values to a Collection With union

The union method will add the $items value to a copy of the existing collection. If there are key collisions between the collection instance and the provided $items, the elements from the collection instance...

Laravel 5 Collections: Breaking a Collection Into a Specified Number of Groups With split

The split method is similar to the chunk method in that it used to break a collection into a smaller number of collections. However, when using the split method, you specify the number of groups you would...

Laravel 5 Collections: Calculating the Average Value of a Collection With average

The average method is simply an alias of the avg method, and can be used in exactly the same way. Signature public function average( $callback = null ); Example Use The following example demonstrates...

Laravel 5 Collections: Calculating the Average Value of a Collection With avg

The avg method is a useful method for calculating the average of all items in the collection. The avg method defines an optional $key parameter, which can be used to specify what property of the collection...