Laravelcollective html表单错误不起作用

问题描述:

错误:FormBuilder.php中的BadMethodCallException行1208: 方法hasErrors不存在。Laravelcollective html表单错误不起作用

因此,我已经像往常一样安装了Laravelcollective,并且大多数方面都在工作。

我composer.json

"laravelcollective/html": "~5.0", 

而且在我的config/app.php提供商

Collective\Html\HtmlServiceProvider::class, 

和别名

'Form' => Collective\Html\FormFacade::class, 
'Html' => Collective\Html\HtmlFacade::class, 

不过,我得到的错误:

BadMethodCa在FormBuilder.php 1208行中有异常: 方法hasErrors不存在。

不太确定这里发生了什么。我的错误在我的html看起来像这样。

{{ Form::hasErrors('name') }} 
{{ Form::errors('name') }} 

我需要为这些安装一个独立的包吗?

由于Laravel Collective中没有hasErrors()errors()方法,您会看到此错误。我刚刚检查了最新版本的软件包的代码。

请使用此参考https://laravelcollective.com/docs/5.3/html。它在安装软件包之前需要满足一些要求,您还需要先检查一下。

结束:

  • 作曲家转储自动加载-o

  • PHP工匠路线:明确

  • PHP工匠缓存:明确

  •  
    
    
        {!! Form::open(['url' => 'AddDataProfileController']) !!} 
         {!!Form::text('email', 'E-Mail Address')!!} 
        {!! Form::close() !!} 
    
     
    
    +1

    你能上,为什么这些三个命令修复阐述问题?例如是否需要优化自动加载器?当前的自动装载机有什么问题吗? – Patrick