5
votes

Error: BadMethodCallException in FormBuilder.php line 1208: Method hasErrors does not exist.

So I have installed Laravelcollective as usual, and most aspects are working.

My composer.json

"laravelcollective/html": "~5.0",

And in my config/app.php providers

 Collective\Html\HtmlServiceProvider::class,

And aliases

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

However, I am getting the error:

BadMethodCallException in FormBuilder.php line 1208: Method hasErrors does not exist.

Not too sure what is going on here. My errors in my html look like this.

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

Do i need to install a seperate package for these?

3

3 Answers

1
votes

You're getting this error because there are no hasErrors() and errors() methods in Laravel Collective. I've just checked the code of the latest version of the package.

0
votes

Please use this reference https://laravelcollective.com/docs/5.3/html. It has requirements you need to meet before installing the package, you need to check it first also.

0
votes

is over:

  • composer dump-autoload -o

  • php artisan route:clear

  • php artisan cache:clear

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