Showing 7 of 1,216 result(s)
The toJson method will return a JSON encoded version of the data stored within the message bag instance. It internally does this by returning a call to PHP's json_encode function, passing in any $options that were supplied. Like the json_encode...
The jsonSeralize method internally returns the value of the toArray method. This method exists to implement PHP's JsonSerializable interface, which allows developers to customize how a class is represented when using the json_encode function.The...
The any method returns a boolean value indicating if the MessageBag instance actually has any messages. The method returns true if the instance has messages, otherwise it returns false .The signature of the any method is: public function any();The...
The keys method is used to retrieve all of keys stored inside the MessageBag instance.The signature of the keys method is: public function keys();The following code example demonstrate the usage of the keys method: After the above code has...
The getMessages method is used to return all of the messages stored within the MessageBag instance. The getMessages method will always return an array. If there are no messages in the message bag, an empty array will be returned.The signature of...
The getFormat is the logical opposite of the setFormat method. It simply returns the current format that is being used by the MessageBag instance.The signature of the getFormat method is: public function getFormat();The following examples...
The merge method is used to combine, or merge , the contents of the MessageBag instance with the provided $messages . The $messages can be any valid array or an object instance that implements the "Illuminate\Contracts\Support\MessageProvider"...