MessageBag
class MessageBag implements Arrayable, Countable, Jsonable, JsonSerializable, MessageBag, MessageProvider (View source)
Methods
Create a new message bag instance.
Get the keys present in the message bag.
Add a message to the bag.
Determine if messages exist for a given key.
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.
Details
at line line 73
$this
merge(
MessageProvider|array $messages)
Merge a new array of messages into the bag.
at line line 116
string
first(
string $key = null,
string $format = null)
Get the first message from the bag for a given key.
at line line 130
array
get(
string $key,
string $format = null)
Get all of the messages from the bag for a given key.
at line line 148
array
all(
string $format = null)
Get all of the messages for every key in the bag.
at line line 167
array
unique(
string $format = null)
Get all of the unique messages for every key in the bag.