October\Rain\Flash\FlashBag

Overview

FlashBag for simple session based messages

Extends
  • Illuminate\Support\MessageBag
Implements
  • Illuminate\Contracts\Support\Arrayable
  • Countable
  • Stringable
  • Illuminate\Contracts\Support\MessageProvider
  • Illuminate\Contracts\Support\MessageBag
  • JsonSerializable
  • Illuminate\Contracts\Support\Jsonable

Protected Properties

protected array $newMessages

newMessages all of the newly registered messages.

protected Session $session

session instance.

Show inherited protected properties

Inherited Protected Properties

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

Public Methods

public __construct()

public __construct($messages = []): void

public add()

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

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

public all()

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

all gets first message for every key in the bag.

public check()

public check(): bool 

check to see if any message is available.

public error()

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

error gets or sets an error message

public forget()

public forget(string $key = null): void

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

public get()

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

get all the flash messages of a given type.

public info()

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

Gets / Sets a information message

public messages()

public messages(): void

public purge()

public purge(): void

purge all flash data from the session.

public store()

public store(): void

store the flash data to the session.

public success()

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

Sets Gets / a success message

public warning()

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

Gets / Sets a warning message

Show inherited public methods

Inherited Public Methods

  • __toString() - Convert the message bag to its string representation. (defined in Illuminate\Support\MessageBag)
  • addIf() - Add a message to the message bag if the given conditional is "true". (defined in Illuminate\Support\MessageBag)
  • any() - Determine if the message bag has any messages. (defined in Illuminate\Support\MessageBag)
  • count() - Get the number of messages in the message bag. (defined in Illuminate\Support\MessageBag)
  • first() - Get the first message from the message bag for a given key. (defined in Illuminate\Support\MessageBag)
  • getFormat() - Get the default message format. (defined in Illuminate\Support\MessageBag)
  • getMessageBag() - Get the messages for the instance. (defined in Illuminate\Support\MessageBag)
  • getMessages() - Get the raw messages in the message bag. (defined in Illuminate\Support\MessageBag)
  • has() - Determine if messages exist for all of the given keys. (defined in Illuminate\Support\MessageBag)
  • hasAny() - Determine if messages exist for any of the given keys. (defined in Illuminate\Support\MessageBag)
  • isEmpty() - Determine if the message bag has any messages. (defined in Illuminate\Support\MessageBag)
  • isNotEmpty() - Determine if the message bag has any messages. (defined in Illuminate\Support\MessageBag)
  • jsonSerialize() - Convert the object into something JSON serializable. (defined in Illuminate\Support\MessageBag)
  • keys() - Get the keys present in the message bag. (defined in Illuminate\Support\MessageBag)
  • merge() - Merge a new array of messages into the message bag. (defined in Illuminate\Support\MessageBag)
  • setFormat() - Set the default message format. (defined in Illuminate\Support\MessageBag)
  • toArray() - Get the instance as an array. (defined in Illuminate\Support\MessageBag)
  • toJson() - Convert the object to its JSON representation. (defined in Illuminate\Support\MessageBag)
  • unique() - Get all of the unique messages for every key in the message bag. (defined in Illuminate\Support\MessageBag)

Protected Methods

Show inherited protected methods

Inherited Protected Methods

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