app/FlashMessages.php
public static function addMessage($text, $status = 'info'): void
    {
        $message         = new stdClass();
        $message->text   = $text;
        $message->status = $status;

        $messages   = Session::get(self::FLASH_KEY, []);
        $messages[] = $message;
        Session::put(self::FLASH_KEY, $messages);
    }
public static function addMessage($text, $status = 'info'): void
    {
        $message         = new stdClass();
        $message->text   = $text;
        $message->status = $status;

        $messages   = Session::get(self::FLASH_KEY, []);
        $messages[] = $message;
        Session::put(self::FLASH_KEY, $messages);
    }
public static function addMessage ( $ text , $ status = 'info' ) : void { $ message = new stdClass ( ) ; $ message -> text = $ text ; $ message -> status = $ status ; $ messages = Session :: get ( self :: FLASH_KEY , [ ] ) ; $ messages [ ] = $ message ; Session :: put ( self :: FLASH_KEY , $ messages ) ; }
Add a message to the session storage.

@param string $text
@param string $status "success", "info", "warning" or "danger"

@return void
Add a message to the session storage .