Bloom Docs

Laravel projects

Make isolated Laravel workspaces useful from the moment they open, with project scripts that prepare Valet, dependencies and data safely.

Prepare a Laravel project

A useful Laravel workspace needs more than a copied checkout. Give every workspace its own URL and database, then install dependencies and migrate it. The setup script below follows the pattern used by There There with Laravel Valet and PostgreSQL.

set -eu

cp "$BLOOM_ROOT_PATH/.env" .env

SITE="my-app-$(printf '%s' "$BLOOM_WORKSPACE_ID" | tr -cd '[:alnum:]' | cut -c1-10)"
valet link "$SITE"
valet secure "$SITE"
sed -i '' "s|^APP_URL=.*|APP_URL=https://$SITE.test|" .env

DATABASE="my_app_$(printf '%s' "$BLOOM_WORKSPACE_ID" | tr -cd '[:alnum:]' | cut -c1-12)"
if ! psql -d postgres -tAc "SELECT 1 FROM pg_database WHERE datname = '$DATABASE'" | grep -q 1; then
    createdb "$DATABASE"
fi
sed -i '' "s|^DB_DATABASE=.*|DB_DATABASE=$DATABASE|" .env

composer install
bun install
bun run build
php artisan migrate --seed --force

Treat that as a pattern, not a paste-ready script. PostgreSQL connection flags, queues, Passport keys and external services differ per project. Add a matching archive script that only unlinks the Valet site and drops databases with your workspace prefix. Never let cleanup operate on the database from the main checkout.

Setup and run scripts

Scripts run with both BLOOM_* and CONDUCTOR_* environment variables set, with the same meanings, so a script written for Conductor runs unchanged.

VariableWhat it holds
*_WORKSPACE_PATHThe worktree directory.
*_ROOT_PATHThe main checkout.
*_WORKSPACE_NAMEThe branch name, with slashes replaced by dashes.
*_WORKSPACE_IDThe workspace's own id.
*_DEFAULT_BRANCHThe project's default branch.
*_PORTThe first of the ten ports allocated to this workspace.
*_IS_LOCALAlways 1. There is no cloud mode.

Get Bloom

Tell us where to send it and the download link is in your inbox in a moment. Bloom is free, and it updates itself once it is installed.