Mr_琅_

132 经验值

我看了讲的form表单那节视频之后,进行如下操作composer require illuminate/html然后按视频说进行的配置,在app.php的'aliases'数组里添加'Form'=> Illuminate\Html\FormFacade::class,没什么问题,但在'providers'数组里添加Illuminate\Html\HtmlServiceProvider::class

我在视图中:

@if($errors->any())
<ul class="alert alert-danger">

@foreach($errors->all() as $error)

<li>{{$error}}</li>

@endforeach

</ul>
@endif

想这样来查看错误信息,但提示

Undefined variable: errors (View: /laravel/resources/views/articles/create.blade.php)

我看了讲的form表单那节视频之后,进行如下操作
composer require illuminate/html
然后按视频说进行的配置,
在app.php的'aliases'数组里添加'Form'=> Illuminate\Html\FormFacade::class,没什么问题,
但在'providers'数组里添加Illuminate\Html\HtmlServiceProvider::class 之后,
运行php artisan serve,会提示Call to undefined method Illuminate\Foundation\Application::bindShared() in laravel/vendor/illuminate/html/HtmlServiceProvider.php