interface MessageBag implements Arrayable, Countable

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 18
array toArray()

Get the instance as an array.

Return Value

array

at line 14
array keys()

Get the keys present in the message bag.

Return Value

array

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

Add a message to the bag.

Parameters

string $key
string $message

Return Value

MessageBag

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

Merge a new array of messages into the bag.

Parameters

MessageProvider|array $messages

Return Value

MessageBag

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

Determine if messages exist for a given key.

Parameters

array|string|null $key

Return Value

bool

at line 38
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 43
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 48
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 55
MessageBag forget(string $key)

Remove a message from the bag.

Parameters

string $key

Return Value

MessageBag

at line 60
array getMessages()

Get the raw messages in the container.

Return Value

array

at line 65
string getFormat()

Get the default message format.

Return Value

string

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

Set the default message format.

Parameters

string $format

Return Value

MessageBag

at line 77
bool isEmpty()

Determine if the message bag has any messages.

Return Value

bool

at line 82
bool isNotEmpty()

Determine if the message bag has any messages.

Return Value

bool