Search

Showing 7 of 1,697 result(s)

/blog/2018/04/21/laravel-5-message-bags-retrieving-the-number-of-messages-with-count

The count method returns the total number of messages stored within the MessageBag instance. The count method exists to satisfy the requirements of PHP's Countable interface.The signature of the count method is: public function count();The...

/blog/2018/04/21/laravel-5-view-error-bags-add-a-new-message-bag-instance-to-the-view-error-bag-with-put#content-resetting-messagebag-messages

Because neither ViewErrorBag or MessageBag provide a method to quickly remove all the messages from a MessageBag instance, the put method can be used to remove all MessageBag messages, or supply new ones, by changing the MessageBag instance for a...

/blog/2018/04/21/laravel-5-view-error-bags-determining-if-a-message-bag-exists-with-hasbag

The hasBag method is used to determine if a MessageBag instance exists within the ViewErrorBag instance with the given $key . The $key is set to default unless it is changed. The following example will highlight the usage of the hasBag method.The...

/blog/2018/04/22/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 modifies the collection instance it was...

/blog/2018/04/22/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 will be used instead. The union method...

/blog/2018/04/22/laravel-5-collections-calculating-the-average-value-of-a-collection-with-avg#content-averaging-nested-collections

The avg method will also work on nested array items or object properties. You can specify which nested property to average by using "dot" notation. For example, in the following array of products it is still possible to use the avg method to...

/blog/2018/04/22/laravel-5-collections-checking-if-a-collection-contains-items-with-isempty

The isEmpty can be used to determine if the collection has items or not. If the collection has no items, true will be returned, otherwise false will be returned.public function isEmpty();The following example demonstrates the basic usage of the...