问题
I have removed a package with composer remove and it's now removed from composer.json and composer.lock files and also removed from vendor directory. But I noticed that it's still listed in these two files: storage/framework/packages.php and storage/framework/services.php. How can I update/rebuild these files?
Also, when I run php artisan in the root of my project, I get this error:
[Symfony\Component\Debug\Exception\FatalThrowableError] Class 'Morilog\Jalali\JalaliServiceProvider' not found
I searched in all the files of the project and found JalaliServiceProvider still listed only in the two above-mentioned files.
回答1:
Remove or comment below line from config/app.php
Morilog\Jalali\JalaliServiceProvider::class
回答2:
Your package is registered in config/app.php. remove the package Morilog\Jalali\JalaliServiceProvider::class
回答3:
Try to run composer dump-autoload in the terminal once
回答4:
Delete these two files:
bootstrap/cache/packages.php
bootstrap/cache/services.php
回答5:
According to this - https://getcomposer.org/doc/articles/scripts.md there is no post-remove-cmd event, therefore whatever you have in your post-update-cmd or post-install-cmd was not executed.
Which suggests it might be the problem with php artisan optimize.
来源:https://stackoverflow.com/questions/47350272/laravel-how-to-update-packages-in-storage-framework