src/Toastr.php
public function addNotification(string $type, string $message, string $title = '', array $options = []): self
    {
        $this->notifications[] = [
            'type'    => in_array($type, $this->allowedTypes, true) ? $type : self::WARNING,
            'title'   => $this->escapeSingleQuote($title),
            'message' => $this->escapeSingleQuote($message),
            'options' => json_encode($options),
        ];

        $this->session->flash(self::TOASTR_NOTIFICATIONS, $this->notifications);

        return $this;
    }
public function addNotification(string $type, string $message, string $title = '', array $options = []): self
    {
        $this->notifications[] = [
            'type'    => in_array($type, $this->allowedTypes, true) ? $type : self::WARNING,
            'title'   => $this->escapeSingleQuote($title),
            'message' => $this->escapeSingleQuote($message),
            'options' => json_encode($options),
        ];

        $this->session->flash(self::TOASTR_NOTIFICATIONS, $this->notifications);

        return $this;
    }
public function addNotification ( string $ type , string $ message , string $ title = '' , array $ options = [ ] ) : self { $ this -> notifications [ ] = [ 'type' => in_array ( $ type , $ this -> allowedTypes , true ) ? $ type : self :: WARNING , 'title' => $ this -> escapeSingleQuote ( $ title ) , 'message' => $ this -> escapeSingleQuote ( $ message ) , 'options' => json_encode ( $ options ) , ] ; $ this -> session -> flash ( self :: TOASTR_NOTIFICATIONS , $ this -> notifications ) ; return $ this ; }
Add a notification.

@param string $type    Could be error, info, success, or warning.
@param string $message The notification's message
@param string $title   The notification's title
@param array  $options

@return Toastr
Add a notification .