public function withErrors($provider)
    {
        if ($provider instanceof MessageProvider) {
            $this->with('errors', $provider->getMessageBag());
        } else {
            $this->with('errors', new MessageBag((array) $provider));
        }

        return $this;
    }
public function withErrors($provider)
    {
        if ($provider instanceof MessageProvider) {
            $this->with('errors', $provider->getMessageBag());
        } else {
            $this->with('errors', new MessageBag((array) $provider));
        }

        return $this;
    }
public function withErrors ( $ provider ) { if ( $ provider instanceof MessageProvider ) { $ this -> with ( 'errors' , $ provider -> getMessageBag ( ) ) ; } else { $ this -> with ( 'errors' , new MessageBag ( ( array ) $ provider ) ) ; } return $ this ; }
Add validation errors to the view.

@param  \Nova\Support\Contracts\MessageProviderInterface|array  $provider
@return \Nova\View\View
Add validation errors to the view .