interface MessageBag implements Arrayable, Countable, Stringable

Methods

array
toArray()

Get the instance as an array.

array
keys()

Get the keys present in the message bag.

add(string $key, string $message)

Add a message to the bag.

merge(MessageProvider|array $messages)

Merge a new array of messages into the bag.

bool
has(array|string|null $key)

Determine if messages exist for a given key.

string
first(string|null $key = null, string|null $format = null)

Get the first message from the bag for a given key.

array
get(string $key, string|null $format = null)

Get all of the messages from the bag for a given key.

array
all(string|null $format = null)

Get all of the messages for every key in the bag.

forget(string $key)

Remove a message from the bag.

array
getMessages()

Get the raw messages in the container.

string
getFormat()

Get the default message format.

setFormat(string $format = ':message')

Set the default message format.

bool
isEmpty()

Determine if the message bag has any messages.

bool
isNotEmpty()

Determine if the message bag has any messages.

Details

in Arrayable at line 17
array toArray()

Get the instance as an array.

Return Value

array

at line 15
array keys()

Get the keys present in the message bag.

Return Value

array

at line 22
MessageBag add(string $key, string $message)

Add a message to the bag.

Parameters

string $key
string $message

Return Value

MessageBag

at line 29
MessageBag merge(MessageProvider|array $messages)

Merge a new array of messages into the bag.

Parameters

MessageProvider|array $messages

Return Value

MessageBag

at line 34
bool has(array|string|null $key)

Determine if messages exist for a given key.

Parameters

array|string|null $key

Return Value

bool

at line 39
string first(string|null $key = null, string|null $format = null)

Get the first message from the bag for a given key.

Parameters

string|null $key
string|null $format

Return Value

string

at line 44
array get(string $key, string|null $format = null)

Get all of the messages from the bag for a given key.

Parameters

string $key
string|null $format

Return Value

array

at line 49
array all(string|null $format = null)

Get all of the messages for every key in the bag.

Parameters

string|null $format

Return Value

array

at line 56
MessageBag forget(string $key)

Remove a message from the bag.

Parameters

string $key

Return Value

MessageBag

at line 61
array getMessages()

Get the raw messages in the container.

Return Value

array

at line 66
string getFormat()

Get the default message format.

Return Value

string

at line 73
MessageBag setFormat(string $format = ':message')

Set the default message format.

Parameters

string $format

Return Value

MessageBag

at line 78
bool isEmpty()

Determine if the message bag has any messages.

Return Value

bool

at line 83
bool isNotEmpty()

Determine if the message bag has any messages.

Return Value

bool