MessageBag
interface MessageBag implements Arrayable, Countable, Stringable
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 17
array
toArray()
Get the instance as an array.
at line 15
array
keys()
Get the keys present in the message bag.
at line 22
MessageBag
add(string $key, string $message)
Add a message to the bag.
at line 29
MessageBag
merge(MessageProvider|array $messages)
Merge a new array of messages into the bag.
at line 34
bool
has(array|string|null $key)
Determine if messages exist for a given key.
at line 39
string
first(string|null $key = null, string|null $format = null)
Get the first message from the bag for a given key.
at line 44
array
get(string $key, string|null $format = null)
Get all of the messages from the bag for a given key.
at line 49
array
all(string|null $format = null)
Get all of the messages for every key in the bag.
at line 56
MessageBag
forget(string $key)
Remove a message from the bag.
at line 61
array
getMessages()
Get the raw messages in the container.
at line 66
string
getFormat()
Get the default message format.
at line 73
MessageBag
setFormat(string $format = ':message')
Set the default message format.
at line 78
bool
isEmpty()
Determine if the message bag has any messages.
at line 83
bool
isNotEmpty()
Determine if the message bag has any messages.