public function setMessage($type, $message)
    {
        if (!is_null($message)) {
            $this->messages[] = [
                'message' => $message,
                'type'    => $type,
            ];
        }

        return $this;
    }
public function setMessage($type, $message)
    {
        if (!is_null($message)) {
            $this->messages[] = [
                'message' => $message,
                'type'    => $type,
            ];
        }

        return $this;
    }
public function setMessage ( $ type , $ message ) { if ( ! is_null ( $ message ) ) { $ this -> messages [ ] = [ 'message' => $ message , 'type' => $ type , ] ; } return $ this ; }
a generic message method for Message helper.
use success, alert, and error methods.

@param string $type
@param string $message
@return ViewData
a generic message method for Message helper . use success alert and error methods .