original_string: public function withErrors($provider)
      {
          if ($provider instanceof MessageProvider) {
              $this->with('errors', $provider->getMessageBag());
          } else {
              $this->with('errors', new MessageBag((array) $provider));
          }
  
          return $this;
      }
code: public function withErrors($provider)
      {
          if ($provider instanceof MessageProvider) {
              $this->with('errors', $provider->getMessageBag());
          } else {
              $this->with('errors', new MessageBag((array) $provider));
          }
  
          return $this;
      }
code_tokens: public function withErrors ( $ provider ) { if ( $ provider instanceof MessageProvider ) { $ this -> with ( 'errors' , $ provider -> getMessageBag ( ) ) ; } else { $ this -> with ( 'errors' , new MessageBag ( ( array ) $ provider ) ) ; } return $ this ; }
docstring: Add validation errors to the view.
  
  @param  \Nova\Support\Contracts\MessageProviderInterface|array  $provider
  @return \Nova\View\View
docstring_tokens: Add validation errors to the view .