protected function addFlash($message, $type = 'info')
    {
        if (!in_array($type, ['info', 'success', 'warning', 'danger'])) {
            throw new \InvalidArgumentException(sprintf('Invalid flash type "%s".', $type));
        }
        $this->getFlashBag()->add($type, $message);
    }
protected function addFlash($message, $type = 'info')
    {
        if (!in_array($type, ['info', 'success', 'warning', 'danger'])) {
            throw new \InvalidArgumentException(sprintf('Invalid flash type "%s".', $type));
        }
        $this->getFlashBag()->add($type, $message);
    }
protected function addFlash ( $ message , $ type = 'info' ) { if ( ! in_array ( $ type , [ 'info' , 'success' , 'warning' , 'danger' ] ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Invalid flash type "%s".' , $ type ) ) ; } $ this -> getFlashBag ( ) -> add ( $ type , $ message ) ; }
Adds a flash message.

@param string $message
@param string $type (info|success|warning|danger)
@throws \InvalidArgumentException
Adds a flash message .