我知道这里有几个类似的问题,但没有一个能解决我的问题。
我正在尝试在 Ubuntu 14.04 上使用 Laravel 5 添加 HtmlServiceProvider。我不断收到以下错误:
dl@dl-VirtualBox:~/l5todo$ composer update
> php artisan clear-compiled
PHP Fatal error: Class 'Illuminate\Html\HtmlServiceProvider' not found in /home/dl/l5todo/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php on line 146
[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'Illuminate\Html\HtmlServiceProvider' not found
Script php artisan clear-compiled handling the pre-update-cmd event returned with an error
[RuntimeException]
Error Output: PHP Fatal error: Class 'Illuminate\Html\HtmlServiceProvider' not found i
n /home/dl/l5todo/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository
.php on line 146
我的 vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository
.php 看起来像:
/**
* Create a new provider instance.
*
* @param string $provider
* @return \Illuminate\Support\ServiceProvider
*/
public function createProvider($provider)
{
return new $provider($this->app);//line 146
}
我的 /.../config/app.php 看起来像:
'providers' => [
Illuminate\Html\HtmlServiceProvider::class, //newly added
......
],
'aliases' => [
'App' => Illuminate\Support\Facades\App::class,
'Artisan' => Illuminate\Support\Facades\Artisan::class,
'Auth' => Illuminate\Support\Facades\Auth::class,
'Blade' => Illuminate\Support\Facades\Blade::class,
'Bus' => Illuminate\Support\Facades\Bus::class,
'Cache' => Illuminate\Support\Facades\Cache::class,
......
'Form' => Illuminate\Html\FormFacade::class,
'Html' => Illuminate\Html\HtmlFacade::class,
],
在我的作曲中。杰森
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.1.*",
"Illuminate/Html": "~5.0"
},
任何帮助将非常感激。如果这个问题对您来说似乎重复,再次抱歉。
composer update
如果我删除我添加的提供程序和别名,则可以使用。但是在我重新添加它们之后,会出现同样的错误。