0

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,
6
  • Have you checked to see if the actual class files exist in the vendor directory? Commented Jan 7, 2016 at 22:05
  • Yes, the class files are there. Commented Jan 7, 2016 at 22:09
  • Can you show the source code of the function you are trying to call? Commented Jan 7, 2016 at 22:23
  • 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. Commented Jan 7, 2016 at 22:55
  • 1
    Thanks for responding, RCrowt. It was a stupid mistake on my part - I had the facades under service providers instead of aliases. Commented Jan 8, 2016 at 21:43

1 Answer 1

2

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.*

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.