/** * Flash a container of errors to the session. * * @param \Nova\Support\Contracts\MessageProviderInterface|array $provider * @param string $key * @return $this */ public function withErrors($provider, $key = 'default') { $value = $this->parseErrors($provider); $this->session->flash('errors', $this->session->get('errors', new ViewErrorBag())->put($key, $value)); return $this; }