I have added "illuminate/html": "5.*" to composer.json and ran "composer update".
- Installing illuminate/html (v5.0.0)
Loading from cache
I ran this command in the root of the website. I modified the composer.json file in /root/.composer... and in the root of the project and neither have made a difference.
This downloaded the class and it seemed to install. I have added the following to file config/app.php.
'Illuminate\Html\HtmlServiceProvider',
'Form' => 'Illuminate\Html\FormFacade',
'Html' => 'Illuminate\Html\HtmlFacade',
I think I have an idea what is wrong, but I don’t know how to fix it. My install is in '/var/www/website'. I have checked the file path and the Html folder does not exist.
"/var/www/website/vendor/laravel/framework/src/Illuminate/Html"
I was able to find the class files, but in a different directory.
"/var/www/website/vendor/illuminate/html"
I manually copied the files over to the main Laravel illuminate/html folder, but this hasn't worked either.
Form
isn't included in laravel
5.0 as it was on 4.0, steps to include it:
Begin by installing laravelcollective/html
package through Composer
. Edit your project's composer.json
file to require:
"require": {
"laravelcollective/html": "~5.0"
}
Next, update composer
from the Terminal:
composer update
Next, add your new provider to the providers
array of config/app.php
:
'providers' => [
// ...
'Collective\Html\HtmlServiceProvider',
// ...
],
Finally, add two class aliases to the aliases
array of config/app.php
:
'aliases' => [
// ...
'Form' => 'Collective\Html\FormFacade',
'Html' => 'Collective\Html\HtmlFacade',
// ...
],
At this point, Form
should be working
Source
Update Laravel 5.8
(2019-04-05):
In Laravel 5.8
, the providers
in the config/app.php
can be declared as:
Collective\Html\HtmlServiceProvider::class,
instead of:
'Collective\Html\HtmlServiceProvider',
This notation is the same for the aliases.
This may not be the answer you're looking for, but I'd recommend using the now community maintained repository Laravel Collective Forms & HTML as the main repositories have been deprecated.
Laravel Collective is in the process of updating their website. You may view the documentation on GitHub if needed.
Just type the following command in terminal at the project directory and installation is done according the Laravel version:
composer require "laravelcollective/html"
Then add these lines in config/app.php
'providers' => [
// ...
Collective\Html\HtmlServiceProvider::class,
// ...
],
'aliases' => [
// ...
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,
// ...
],
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With