I moved my project from desk to another.
When I run php artisan
it does not work.
I tried to run composer update
, but it returns the
I had this same problem when running composer update
in a Laravel project. In the package.json it's configured to run artisan package:discover
, which failed with:
Class 'Symfony\Component\Translation\Translator' not found in vendor/nesbot/carbon/src/Carbon/Translator.php on line 18
When I looked in the vendor/symfony/translation
directory I found that it was completely empty, which explained the error.
The solution was to completely delete the vendor
directory and then re-run composer update
. This was the only way that I was able to make composer install the missing files.
If this happened after Laravel update from 6.x to 7.x, then this could be due to the update of Symfony. See the upgrade guide of this part: https://laravel.com/docs/7.x/upgrade#symfony-5-related-upgrades