Preview environments for Laravel + Next.js
Why previewing this stack is fiddly
A decoupled Next + Laravel PR is two deploys to coordinate
You are not standing up one app — you are standing up an API and a Next.js Node server that have to find each other. The API URL has to be right twice (server and browser), CORS or cookie domains have to line up, and any ISR cache from a previous run has to be gone.
Both services, fully wired
What every Laravel + Next.js preview includes
One VPS runs the PHP API and the Next.js Node server side by side, with backing services and the cross-service URLs set for you.
The build, automated
Both services, declared once and run on every push
You give us the commands for each service and the two cross-service URLs. We run them in clean containers — no bespoke CI, no SSH, no juggling two pipelines.
# api — Laravel composer install --optimize-autoloader php artisan migrate --seed # isolated DB, realistic data php artisan queue:work & php artisan schedule:work # web — Next.js (App Router, standalone output) npm ci NEXT_PUBLIC_API_URL=https://acme-shop-pr82.admn.cloud \ API_INTERNAL_URL=http://127.0.0.1:8000 next build node .next/standalone/server.js # or: next start ✓ ready https://acme-shop-pr82.admn.cloud
How it works
From branch to a wired two-service URL
Questions
Laravel + Next.js preview environments, answered
Ship your next Laravel + Next.js PR with a live URL
Connect GitHub and get both services — API and Next.js frontend — provisioned, wired and seeded for every branch, then destroyed without a trace.
