把()当我试图通过验证返回错误象下面这样:调用未定义的方法照亮的 Support MessageBag ::在Laravel 5.3
return Redirect::back()->withErrors($validator)->withInput();
它给我这个错误:
Call to undefined method Illuminate\Support\MessageBag::put()
其是: vendor\laravel\framework\src\Illuminate\Http\RedirectResponse.php line 133
的代码是:
/**
* Flash a container of errors to the session.
*
* @param \Illuminate\Contracts\Support\MessageProvider|array|string $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;
}
当你看到它应该使用put方法从ViewErrorBag不MessageBag!
任何帮助,将不胜感激...