interface MessageBag implements Arrayable

Methods

array
toArray()

Get the instance as an array.

array
keys()

Get the keys present in the message bag.

$this
add(string $key, string $message)

Add a message to the bag.

$this
merge(MessageProvider|array $messages)

Merge a new array of messages into the bag.

bool
has(string|array $key)

Determine if messages exist for a given key.

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

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

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

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

array
all(string $format = null)

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

string
getFormat()

Get the default message format.

$this
setFormat(string $format = ':message')

Set the default message format.

bool
isEmpty()

Determine if the message bag has any messages.

int
count()

Get the number of messages in the container.

Details

in Arrayable at line 12
array toArray()

Get the instance as an array.

Return Value

array

at line 12
array keys()

Get the keys present in the message bag.

Return Value

array

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

Add a message to the bag.

Parameters

string $key
string $message

Return Value

$this

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

Merge a new array of messages into the bag.

Parameters

MessageProvider|array $messages

Return Value

$this

at line 37
bool has(string|array $key)

Determine if messages exist for a given key.

Parameters

string|array $key

Return Value

bool

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

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

Parameters

string $key
string $format

Return Value

string

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

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

Parameters

string $key
string $format

Return Value

array

at line 63
array all(string $format = null)

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

Parameters

string $format

Return Value

array

at line 70
string getFormat()

Get the default message format.

Return Value

string

at line 78
$this setFormat(string $format = ':message')

Set the default message format.

Parameters

string $format

Return Value

$this

at line 85
bool isEmpty()

Determine if the message bag has any messages.

Return Value

bool

at line 92
int count()

Get the number of messages in the container.

Return Value

int