class MessageBag implements Arrayable, Countable, Jsonable, JsonSerializable, MessageBag, MessageProvider (View source)
void | __construct(array $messages = array()) Create a new message bag instance. | |
array | keys() Get the keys present in the message bag. | |
$this | add(string $key, string $message) Add a message to the bag. | |
$this | merge(MessageProvider|array $messages) Merge a new array of messages into the bag. | |
bool | has(string|array $key) Determine if messages exist for all of the given keys. | |
bool | hasAny(array $keys = array()) Determine if messages exist for any of the given keys. | |
string | first(string $key = null, string $format = null) Get the first message from the bag for a given key. | |
array | get(string $key, string $format = null) Get all of the messages from the bag for a given key. | |
array | all(string $format = null) Get all of the messages for every key in the bag. | |
array | unique(string $format = null) Get all of the unique messages for every key in the bag. | |
array | messages() Get the raw messages in the container. | |
array | getMessages() Get the raw messages in the container. | |
MessageBag | getMessageBag() Get the messages for the instance. | |
string | getFormat() Get the default message format. | |
$this | setFormat(string $format = ':message') Set the default message format. | |
bool | isEmpty() Determine if the message bag has any messages. | |
bool | any() Determine if the message bag has any messages. | |
int | count() Get the number of messages in the container. | |
array | toArray() Get the instance as an array. | |
array | jsonSerialize() Convert the object into something JSON serializable. | |
string | toJson(int $options) Convert the object to its JSON representation. | |
string | __toString() Convert the message bag to its string representation. |
Create a new message bag instance.
Get the keys present in the message bag.
Add a message to the bag.
Merge a new array of messages into the bag.
Determine if messages exist for all of the given keys.
Determine if messages exist for any of the given keys.
Get the first message from the bag for a given key.
Get all of the messages from the bag for a given key.
Get all of the messages for every key in the bag.
Get all of the unique messages for every key in the bag.
Get the raw messages in the container.
Get the raw messages in the container.
Get the messages for the instance.
Get the default message format.
Set the default message format.
Determine if the message bag has any messages.
Determine if the message bag has any messages.
Get the number of messages in the container.
Get the instance as an array.
Convert the object into something JSON serializable.
Convert the object to its JSON representation.
Convert the message bag to its string representation.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.3/Illuminate/Support/MessageBag.html