FlashBag

Simple flash bag

 class Winter\Storm\Flash\FlashBag
extends Illuminate\Support\MessageBag

Extends

Constants

Constant Description
ERROR
string "error"
INFO
string "info"
SESSION_KEY
string "_flash_oc"
SUCCESS
string "success"
WARNING
string "warning"

Properties

protected $newMessages : array

All of the newly registered messages.

protected $session : mixed

Session instance.

Methods

public __construct (array $messages = [])

Parameters
Property Description
$messages
array
Returns
mixed

public add (string $key, string $message) : Winter\Storm\Flash\FlashBag

Add a message to the bag and stores it in the session.

Parameters
Property Description
$key
string
$message
string
Returns

public all (string | null $format = null) : array

Get first message for every key in the bag.

Parameters
Property Description
$format
string | null
Returns
array

public check () : bool

Checks to see if any message is available.

Returns
bool

public error (string | null $message = null) : array | FlashBag

Gets / Sets an error message

Parameters
Property Description
$message
string | null
Returns
array | FlashBag

public forget (string $key = null)

Removes an object with a specified key or erases the flash data.

Parameters
Property Description
$key
string

Specifies a key to remove, optional

Returns
mixed

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

Gets all the flash messages of a given type.

Parameters
Property Description
$key
string
$format
string | null
Returns
array

public info (string | null $message = null) : array | FlashBag

Gets / Sets a information message

Parameters
Property Description
$message
string | null
Returns
array | FlashBag

public purge ()

Returns
mixed

public store ()

Stores the flash data to the session.

Returns
mixed

public success (string | null $message = null) : array | FlashBag

Sets Gets / a success message

Parameters
Property Description
$message
string | null
Returns
array | FlashBag

public warning (string | null $message = null) : array | FlashBag

Gets / Sets a warning message

Parameters
Property Description
$message
string | null
Returns
array | FlashBag
Copyright © 2024 Winter CMS