public function withError($title = '', $message = '')
    {
        $error = new MessageBag(compact('title', 'message'));

        session()->flash('error', $error);

        return $this;
    }
public function withError($title = '', $message = '')
    {
        $error = new MessageBag(compact('title', 'message'));

        session()->flash('error', $error);

        return $this;
    }
public function withError ( $ title = '' , $ message = '' ) { $ error = new MessageBag ( compact ( 'title' , 'message' ) ) ; session ( ) -> flash ( 'error' , $ error ) ; return $ this ; }
Set error message for content.

@param string $title
@param string $message

@return $this
Set error message for content .