public function addError($error)
    {
        $errors = $this->getAttribute('errors') ?: [];

        $errors[] = $error;

        $this->setAttribute('errors', $errors);

        return $this;
    }
public function addError($error)
    {
        $errors = $this->getAttribute('errors') ?: [];

        $errors[] = $error;

        $this->setAttribute('errors', $errors);

        return $this;
    }
public function addError ( $ error ) { $ errors = $ this -> getAttribute ( 'errors' ) ? : [ ] ; $ errors [ ] = $ error ; $ this -> setAttribute ( 'errors' , $ errors ) ; return $ this ; }
Adds a single error to the error list

@param string $error
@return $this
Adds a single error to the error list