Search

Showing 7 of 1,216 result(s)

/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/21/laravel-5-view-error-bags-determining-if-there-are-any-error-messages-with-any

The any method can be used to determine if the error message bag contains any messages. It is a convenience method and acts a shortcut to calling the count method within a conditional statement. The any method returns a boolean value.The signature...

/blog/2018/04/21/laravel-5-view-error-bags-getting-all-message-bag-instances-with-getbags

The getBags method is used to return an associative array containing all the MessageBag instances that are currently stored within the ViewErrorBag instance.The signature of the getBags method is: public function getBags();The following example...

/blog/2018/04/21/laravel-5-view-error-bags-getting-the-message-bag-instance-with-getbag

The getBag method can be used to retrieve a MessageBag instance associated with the provided $key . If a MessageBag instance does not exist with the provided $key , a new instance of "Illuminate\Support\MessageBag" will returned instead. The...

/blog/2018/04/21/laravel-5-view-error-bags-getting-the-number-of-error-messages-with-count

The count method returns the number of messages stored within the default MessageBag instance. It is also the only MessageBag method that specifically handled by the ViewErrorBag instance itself because it needs to be declared within the...

/blog/2018/04/22/laravel-5-collections-adding-an-element-to-the-beginning-of-a-collection-with-prepend

The prepend method will add a a given $value to the beginning of the collection. You can also supply an optional $key that will be used as the key for the new $value when adding an item to the beginning of an associative array. The prepend method...

/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...