问题
I'm a Ubuntu/git/composer noob, and I'm trying to follow the installation instructions here.
After running the php artisan config:publish loic-sharma/profiler
command I get the following error:
PHP Fatal error: Class 'Profiler\ProfilerServiceProvider' not found in /var/www/epcr/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php on line 158
I'm assuming the problem is that I haven't downloaded the code, but I'm not exactly sure how to go about doing that.
回答1:
Most packages require you to manually add service provider in app/config/app.php. There is an array of providers inside. Some providers require also facade alias.
So take a look at documentation, if it is provider, then it should be documented.
e.g.
'Miro\JSONSuite\JSONSuiteServiceProvider'
回答2:
Try running composer dump-autoload
回答3:
I needed to run composer update
after I added the require to my composer.json file. After that I had a few permissions I needed to update and it worked after that.
来源:https://stackoverflow.com/questions/21980392/how-to-install-laravel-4-profiler