The question is published on by Tutorial Guruji team.
I understand that there are several similar questions here but none of them fixed my problem.
I’m trying to add the HtmlServiceProvider with Laravel 5 on Ubuntu 14.04. I keep getting the following error:
dl@dl-VirtualBox:~/l5todo$ composer update > php artisan clear-compiled PHP Fatal error: Class 'IlluminateHtmlHtmlServiceProvider' not found in /home/dl/l5todo/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php on line 146 [SymfonyComponentDebugExceptionFatalErrorException] Class 'IlluminateHtmlHtmlServiceProvider' not found Script php artisan clear-compiled handling the pre-update-cmd event returned with an error [RuntimeException] Error Output: PHP Fatal error: Class 'IlluminateHtmlHtmlServiceProvider' not found i n /home/dl/l5todo/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository .php on line 146
My vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository
.php looks like:
/** * Create a new provider instance. * * @param string $provider * @return IlluminateSupportServiceProvider */ public function createProvider($provider) { return new $provider($this->app);//line 146 }
My /…/config/app.php looks like:
'providers' => [ IlluminateHtmlHtmlServiceProvider::class, //newly added ...... ], 'aliases' => [ 'App' => IlluminateSupportFacadesApp::class, 'Artisan' => IlluminateSupportFacadesArtisan::class, 'Auth' => IlluminateSupportFacadesAuth::class, 'Blade' => IlluminateSupportFacadesBlade::class, 'Bus' => IlluminateSupportFacadesBus::class, 'Cache' => IlluminateSupportFacadesCache::class, ...... 'Form' => IlluminateHtmlFormFacade::class, 'Html' => IlluminateHtmlHtmlFacade::class, ],
In my compose.Jason
"require": { "php": ">=5.5.9", "laravel/framework": "5.1.*", "Illuminate/Html": "~5.0" },
Any help would be really appreciated. Sorry again if this question seems duplicated to you.
composer update
works if I remove provider and aliases I added. But after I add them back in, same error appears.
Answer
Step 1
In composer.json under require, add:
"laravelcollective/html": "5.1.*",
Step 2
run composer update
in your terminal
Step 3
Add the following in config/app.php under providers:
CollectiveHtmlHtmlServiceProvider::class,
Step 4
Add the following in config/app.php under aliases:
'Form' => CollectiveHtmlFormFacade::class,
'Html' => CollectiveHtmlHtmlFacade::class,