问题
爱L5。但过去24小时是一场噩梦。我的第三方服务提供商(SP)都没有加载。我做了一个干净的L5安装并尝试添加SP但仍然无法正常工作。
运行vendor
时,SP会在composer update
文件夹中按原样安装。但是在运行L5时,我收到错误消息Class 'LaravelLocalization' not found
composer.json
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.2.*",
"twbs/bootstrap": "*",
"intervention/image": "*",
"laravelcollective/html": "*",
"barryvdh/laravel-debugbar": "*",
"davibennun/laravel-push-notification": "dev-laravel5",
"mcamara/laravel-localization": "1.1.*",
"tijsverkoyen/css-to-inline-styles": "1.5.5",
"league/csv": "*"
},
的app.config
提供商
/*
* Laravel Framework Service Providers...
*/
Illuminate\Auth\AuthServiceProvider::class,
Illuminate\Broadcasting\BroadcastServiceProvider::class,
Illuminate\Bus\BusServiceProvider::class,
Illuminate\Cache\CacheServiceProvider::class,
Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
Illuminate\Cookie\CookieServiceProvider::class,
Illuminate\Database\DatabaseServiceProvider::class,
Illuminate\Encryption\EncryptionServiceProvider::class,
Illuminate\Filesystem\FilesystemServiceProvider::class,
Illuminate\Foundation\Providers\FoundationServiceProvider::class,
Illuminate\Hashing\HashServiceProvider::class,
Illuminate\Mail\MailServiceProvider::class,
Illuminate\Pagination\PaginationServiceProvider::class,
Illuminate\Pipeline\PipelineServiceProvider::class,
Illuminate\Queue\QueueServiceProvider::class,
Illuminate\Redis\RedisServiceProvider::class,
Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
Illuminate\Session\SessionServiceProvider::class,
Illuminate\Translation\TranslationServiceProvider::class,
Illuminate\Validation\ValidationServiceProvider::class,
Illuminate\View\ViewServiceProvider::class,
Collective\Html\HtmlServiceProvider::class,
/*
* Application Service Providers...
*/
App\Providers\AppServiceProvider::class,
App\Providers\AuthServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
/*
* 3rd Party Service Providers...
*/
Barryvdh\Debugbar\ServiceProvider::class,
Intervention\Image\ImageServiceProvider::class,
Davibennun\LaravelPushNotification\LaravelPushNotificationServiceProvider::class,
Mcamara\LaravelLocalization\LaravelLocalizationServiceProvider::class
别名
'App' => Illuminate\Support\Facades\App::class,
'Artisan' => Illuminate\Support\Facades\Artisan::class,
'Auth' => Illuminate\Support\Facades\Auth::class,
'Blade' => Illuminate\Support\Facades\Blade::class,
'Cache' => Illuminate\Support\Facades\Cache::class,
'Config' => Illuminate\Support\Facades\Config::class,
'Cookie' => Illuminate\Support\Facades\Cookie::class,
'Crypt' => Illuminate\Support\Facades\Crypt::class,
'DB' => Illuminate\Support\Facades\DB::class,
'Eloquent' => Illuminate\Database\Eloquent\Model::class,
'Event' => Illuminate\Support\Facades\Event::class,
'File' => Illuminate\Support\Facades\File::class,
'Gate' => Illuminate\Support\Facades\Gate::class,
'Hash' => Illuminate\Support\Facades\Hash::class,
'Lang' => Illuminate\Support\Facades\Lang::class,
'Log' => Illuminate\Support\Facades\Log::class,
'Mail' => Illuminate\Support\Facades\Mail::class,
'Password' => Illuminate\Support\Facades\Password::class,
'Queue' => Illuminate\Support\Facades\Queue::class,
'Redirect' => Illuminate\Support\Facades\Redirect::class,
'Redis' => Illuminate\Support\Facades\Redis::class,
'Request' => Illuminate\Support\Facades\Request::class,
'Response' => Illuminate\Support\Facades\Response::class,
'Route' => Illuminate\Support\Facades\Route::class,
'Schema' => Illuminate\Support\Facades\Schema::class,
'Session' => Illuminate\Support\Facades\Session::class,
'Storage' => Illuminate\Support\Facades\Storage::class,
'URL' => Illuminate\Support\Facades\URL::class,
'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class,
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,
'Debugbar' => Barryvdh\Debugbar\Facade::class,
'Image' => Intervention\Image\Facades\Image::class,
'PushNotification' => Davibennun\LaravelPushNotification\Facades\PushNotification::class,
'LaravelLocalization' => Mcamara\LaravelLocalization\Facades\LaravelLocalization::class
我尝试过的事情
Laravel 5.2 Service provider not booting
php artisan clear-compiled
composer dump-autoload
php artisan optimize
Laravel - Composer unable to find the service provider class
composer clear
我也烧焦了互联网,但干了...... :( https://laracasts.com/discuss/channels/general-discussion/laravel-5-package-serviceprovider-cant-be-found)
思想吗
任何想法如何克服非常感谢。现在无法运行应用程序并丢失了一天的工作..:/
更新
autoload_files.php
中的vendor/composer
不包含某些框架。 barryvdh/laravel-debugbar
是其中的一部分(未加载)但例如Mcamara\LaravelLocalization
不属于autoload_files。
但是Mcamara\LaravelLocalization
是autoload_static.php
下$prefixesPsr0
的一部分 - 如果有帮助吗?
autoload_files.php(在/ vendor / composer /中)
return array(
'1d1b89d124cc9cb8219922c9d5569199' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest.php',
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
'667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php',
'bd9634f2d41831496de0d3dfe4c94881' => $vendorDir . '/symfony/polyfill-php56/bootstrap.php',
'2c102faa651ef8ea5874edb585946bce' => $vendorDir . '/swiftmailer/swiftmailer/lib/swift_required.php',
'e7223560d890eab89cda23685e711e2c' => $vendorDir . '/psy/psysh/src/Psy/functions.php',
'5255c38a0faeba867671b61dfda6d864' => $vendorDir . '/paragonie/random_compat/lib/random.php',
'f0906e6318348a765ffb6eb24e0d0938' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/helpers.php',
'58571171fd5812e6e447dce228f52f4d' => $vendorDir . '/laravel/framework/src/Illuminate/Support/helpers.php',
'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php',
'f18cc91337d49233e5754e93f3ed9ec3' => $vendorDir . '/laravelcollective/html/src/helpers.php',
'4a1f389d6ce373bda9e57857d3b61c84' => $vendorDir . '/barryvdh/laravel-debugbar/src/helpers.php',
);
解
第一次干净安装L5,我在SP中逐个添加,似乎可行。很高兴回到正轨。 不能完全感谢大家 - 大声喊出@MikeBarwick ,他们提供了很好的指导 - 谢谢! :)
答案 0 :(得分:0)
试试这个:
composer dump-autoload --optimize