5

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 Answers3

1

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.

Alexey Mezenin
  • 158,981
  • 26
  • 290
  • 279
0

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.

Jrey
  • 1,618
  • 2
  • 17
  • 34
0

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() !!}
    
    
    
    Namroy
    • 99
    • 1
    • 3
    • 1
      Can you elaborate on why those three commands fix the problem? e.g. is optimizing the autoloader necessary? was there something wrong with the current autoloader? – Patrick May 17 '17 at 21:28