0
votes

I'm using Laravel v5.2 and have followed the instructions below to install laravelcollective/html, but it still throws errors:

Browser: FatalErrorException in ProviderRepository.php line 119: Call to undefined method Collective\Html\FormFacade::isDeferred()

Artisan: [Symfony\Component\Debug\Exception\FatalErrorException] Call to undefined method Collective\Html\FormFacade::isDeferred()

Also tried 5.2.*-dev, but get the same errors.

Hope someone can help!

Command:

composer require laravelcollective/html

Added to composer.json "require" group:

"laravelcollective/html": "5.2.*"
composer update

Added to config/app.php in providers group:

Collective\Html\HtmlServiceProvider::class,

In aliases group:

'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,
1
Have you checked to see if the actual class files exist in the vendor directory?RCrowt
Yes, the class files are there.Tim Spencer
Can you show the source code of the function you are trying to call?RCrowt
Heh. Haven't gotten that far yet. This is just the initial setup. I'm doing a tutorial (flynsarmy.com/2015/02/…) and Part 2 begins with requiring laravelcollective/html. The author is is using 5.0, I'm on 5.2. Maybe I should just start over using L5.0.Tim Spencer
Thanks for responding, RCrowt. It was a stupid mistake on my part - I had the facades under service providers instead of aliases.Tim Spencer

1 Answers

2
votes

I hope it is not too late, but maybe answer on your question will be useful for a future reference. So, here is step by step:

1) In the root of your laravel package open composer.json file in "require" group should be added this line:

"laravelcollective/html": "5.2.*"

It should look similar to: "require": { "php": ">=5.5.9", "laravel/framework": "5.2.", "laravelcollective/html": "5.2." },

2) Open command prompt or Git Bash and update the composer with command:

composer update

The composer will update within about one or two minutes.

3) Open config/app.php add this line in providers group:

Collective\Html\HtmlServiceProvider::class,

and don't forget to separate the previous class by comma. It should look like:

Illuminate\Validation\ValidationServiceProvider::class,
Illuminate\View\ViewServiceProvider::class,
Collective\Html\HtmlServiceProvider::class,

4) In the same file in aliases group add these alias:

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

so it should look like:

'View' => Illuminate\Support\Facades\View::class,
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,

I hope this will help to anyone who use Laravel 5.2.*