Speeding Up Laravel Tests with tmpfs (MySQL in RAM)
If your Laravel test suite is painfully slow and does a lot of database work (multi-tenancy, migrations, seeding), the bottleneck is almost…
You ran composer update when you meant to run composer install, and now your dependencies are all over the place. Here's how to fix it.
If you're not using Sail:
# Delete current state
rm -rf vendor/
rm composer.lock
# Get the old lock file from git
git checkout composer.lock
# Reinstall everything based on this old lock file
composer install
If you're using Sail, there's a catch: Sail lives in your vendor directory! When you delete vendor/, you can't use sail composer install anymore. Here's how to fix it:
# Delete current state
rm -rf vendor/
rm composer.lock
# Get the old lock file
git checkout composer.lock
# Run composer install via Docker directly
docker run --rm \
-u "$(id -u):$(id -g)" \
-v "$(pwd):/var/www/html" \
-w /var/www/html \
laravelsail/php83-composer:latest \
composer install --ignore-platform-reqs
Replace php83 in laravelsail/php83-composer:latest with your PHP version:
laravelsail/php74-composer:latestlaravelsail/php80-composer:latestlaravelsail/php81-composer:latestlaravelsail/php82-composer:latestlaravelsail/php83-composer:latestAfter this runs, Sail will be back in your vendor directory and you can use it normally again.
If you already committed the unwanted composer.lock changes, you need to get back the old version first:
# Show the commit history of composer.lock
git log composer.lock
# You'll see something like:
# commit 123abc... (HEAD -> main) Bad update from yesterday
# commit 456def... Good state from last week
# commit 789ghi... Even older changes
# Get back the old version using the 'good' commit hash
git checkout 456def composer.lock
# Then continue with the steps above for your case (Sail or non-Sail)
Give Vroni a GitHub issue, bug report, spec, or rough idea. It reads the repo, plans the change, writes code, runs checks, and works toward a review-ready pull request.
Take a look at vroni.com