FlashBag
Simple flash bag
class Winter\Storm\Flash\FlashBag
extends Illuminate\Support\MessageBag
Extends
Class | Description |
---|---|
Illuminate\Support\MessageBag
|
Constants
Constant | Type | Value | Description |
---|---|---|---|
ERROR
|
string |
"error"
|
string
"error"
|
INFO
|
string |
"info"
|
string
"info"
|
SESSION_KEY
|
string |
"_flash_oc"
|
string
"_flash_oc"
|
SUCCESS
|
string |
"success"
|
string
"success"
|
WARNING
|
string |
"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 | Type | Description |
---|---|---|
$messages | array |
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 | Type | Description |
---|---|---|
$key | string |
string
|
$message | string |
string
|
Returns
public
all (string | null $format = null
)
: array
Get first message for every key in the bag.
Parameters
Property | Type | Description |
---|---|---|
$format | string | null |
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 | Type | Description |
---|---|---|
$message | string | null |
string | null
|
Returns
array | FlashBag
public
forget (string $key = null
)
Removes an object with a specified key or erases the flash data.
Parameters
Property | Type | Description |
---|---|---|
$key | string |
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 | Type | Description |
---|---|---|
$key | string |
string
|
$format | string | null |
string | null
|
Returns
array
public
info (string | null $message = null
)
: array | FlashBag
Gets / Sets a information message
Parameters
Property | Type | Description |
---|---|---|
$message | string | null |
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 | Type | Description |
---|---|---|
$message | string | null |
string | null
|
Returns
array | FlashBag
public
warning (string | null $message = null
)
: array | FlashBag
Gets / Sets a warning message
Parameters
Property | Type | Description |
---|---|---|
$message | string | null |
string | null
|
Returns
array | FlashBag
Copyright © 2024 Winter CMS