MessageBag
interface MessageBag implements Arrayable, Countable
Methods
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.
Remove a message from the bag.
Get the raw messages in the container.
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.
Details
in
Arrayable at line 18
array
toArray()
Get the instance as an array.
at line 14
array
keys()
Get the keys present in the message bag.
at line 21
MessageBag
add(string $key, string $message)
Add a message to the bag.
at line 28
MessageBag
merge(MessageProvider|array $messages)
Merge a new array of messages into the bag.
at line 33
bool
has(array|string|null $key)
Determine if messages exist for a given key.
at line 38
string
first(string|null $key = null, string|null $format = null)
Get the first message from the bag for a given key.
at line 43
array
get(string $key, string|null $format = null)
Get all of the messages from the bag for a given key.
at line 48
array
all(string|null $format = null)
Get all of the messages for every key in the bag.
at line 55
MessageBag
forget(string $key)
Remove a message from the bag.
at line 60
array
getMessages()
Get the raw messages in the container.
at line 65
string
getFormat()
Get the default message format.
at line 72
MessageBag
setFormat(string $format = ':message')
Set the default message format.
at line 77
bool
isEmpty()
Determine if the message bag has any messages.
at line 82
bool
isNotEmpty()
Determine if the message bag has any messages.