My project has been working fine until recently, when I ran sudo composer self-update
. Composer successfully updated but I could no longer migrate (php artisan migrate
). This is the error I get:
PHP Fatal error: Class 'Patchwork\Utf8\Bootup' not found in /Applications/MAMP/htdocs/ThumbsUp/bootstrap/autoload.php on line 46
I have ran composer update
and composer install
, and still this error persists. Why would it not be finding this class after the self-update
?
In tracking down this issue, I found it had to do with this in my composer.json:
"pre-update-cmd": [ "php artisan clear-compiled" ],
My theory is that "clear-compiled" can't work because composer hasn't been updated. Deleting this, and then calling
composer update
and then re-adding it fixed my issue.I just removed composer.lock file and then run
composer update
And it worked.I had a similar issue when trying to run composer update and none of the solutions above had worked. It turns out I had 2 require sections in my composer.json which is actually wrong.
Combining the two as below solved my issue.
If you still have a problem, try deleting the composer.lock and the vendor directory and run
To clear the composer cache and finally run
This should solve the issue.
I had the same problem, I ran
composer dump-autoload
orphp composer.phar dump-autoload
depending on your configuration, ran composer update again and it worked.