October\Rain\Flash\FlashBag

Source: ~/vendor/october/rain/src/Flash/FlashBag.php

Extends:

  • Illuminate\Support\MessageBag

Implements:

  • Illuminate\Contracts\Support\MessageProvider
  • Illuminate\Contracts\Support\MessageBag
  • JsonSerializable
  • Illuminate\Contracts\Support\Jsonable
  • Countable
  • Illuminate\Contracts\Support\Arrayable

Simple flash bag

Protected properties

protected array $newMessages

All of the newly registered messages.

protected $session

Session instance.

Show inherited protected properties

Inherited protected properties

  • protected array $messages - defined in Illuminate\Support\MessageBag. All of the registered messages.
  • protected string $format - defined in Illuminate\Support\MessageBag. Default format for message output.

Public methods

public void __construct($messages=array())
Parameters
  • $messages

public October\Rain\Flash\FlashBag add(string $key, string $message)

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

Parameters
  • string $key
  • string $message

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

Get first message for every key in the bag.

Parameters
  • string|null $format

public bool check()

Checks to see if any message is available.

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

Gets / Sets an error message

Parameters
  • string|null $message

public void forget(string $key=NULL)

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

Parameters
  • string $key - Specifies a key to remove, optional

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

Gets all the flash messages of a given type.

Parameters
  • string $key
  • string|null $format

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

Gets / Sets a information message

Parameters
  • string|null $message

public void purge()

public void store()

Stores the flash data to the session.

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

Sets Gets / a success message

Parameters
  • string|null $message

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

Gets / Sets a warning message

Parameters
  • string|null $message

Show inherited public methods

Inherited public methods

  • public string __toString() - defined in Illuminate\Support\MessageBag. Convert the message bag to its string representation.
  • public bool any() - defined in Illuminate\Support\MessageBag. Determine if the message bag has any messages.
  • public int count() - defined in Illuminate\Support\MessageBag. Get the number of messages in the container.
  • public string first(string $key=NULL, string $format=NULL) - defined in Illuminate\Support\MessageBag. Get the first message from the bag for a given key.
  • public string getFormat() - defined in Illuminate\Support\MessageBag. Get the default message format.
  • public Illuminate\Support\MessageBag getMessageBag() - defined in Illuminate\Support\MessageBag. Get the messages for the instance.
  • public array getMessages() - defined in Illuminate\Support\MessageBag. Get the raw messages in the container.
  • public bool has(array|string $key) - defined in Illuminate\Support\MessageBag. Determine if messages exist for all of the given keys.
  • public bool hasAny(array|string $keys=array()) - defined in Illuminate\Support\MessageBag. Determine if messages exist for any of the given keys.
  • public bool isEmpty() - defined in Illuminate\Support\MessageBag. Determine if the message bag has any messages.
  • public bool isNotEmpty() - defined in Illuminate\Support\MessageBag. Determine if the message bag has any messages.
  • public array jsonSerialize() - defined in Illuminate\Support\MessageBag. Convert the object into something JSON serializable.
  • public array keys() - defined in Illuminate\Support\MessageBag. Get the keys present in the message bag.
  • public $this merge(Illuminate\Contracts\Support\MessageProvider|array $messages) - defined in Illuminate\Support\MessageBag. Merge a new array of messages into the bag.
  • public array messages() - defined in Illuminate\Support\MessageBag. Get the raw messages in the container.
  • public Illuminate\Support\MessageBag setFormat(string $format=':message') - defined in Illuminate\Support\MessageBag. Set the default message format.
  • public array toArray() - defined in Illuminate\Support\MessageBag. Get the instance as an array.
  • public string toJson(int $options=0) - defined in Illuminate\Support\MessageBag. Convert the object to its JSON representation.
  • public array unique(string $format=NULL) - defined in Illuminate\Support\MessageBag. Get all of the unique messages for every key in the bag.

Protected methods

Show inherited protected methods

Inherited protected methods

  • protected string checkFormat(string $format) - defined in Illuminate\Support\MessageBag. Get the appropriate format based on the given format.
  • protected array getMessagesForWildcardKey(string $key, string|null $format) - defined in Illuminate\Support\MessageBag. Get the messages for a wildcard key.
  • protected bool isUnique(string $key, string $message) - defined in Illuminate\Support\MessageBag. Determine if a key and message combination already exists.
  • protected array transform(array $messages, string $format, string $messageKey) - defined in Illuminate\Support\MessageBag. Format an array of messages.