Client work in Laravel rarely fails on code. It stalls between "it's done on my machine" and "the client signed off." This guide covers how to give a client a live Laravel preview, how the common options compare, and how to collect feedback and an approval on the exact build you deployed.

What a preview environment (review app) is

A preview environment, often called a review app, is a short-lived, isolated deployment of one version of your app with its own URL. It exists for one purpose: someone looks at it, gives feedback, and decides. When the review is over, it goes away. That is different from a shared staging server, which lives indefinitely and usually reflects whatever was merged last.

Ways to share a Laravel app with a client

OptionGood atWatch out for
Shared staging serverPersistent, mirrors productionOne version at a time; provisioning and upkeep
Local app + tunnel (e.g. ngrok)Instant, zero deployOnly live while your laptop and tunnel run
Laravel Cloud preview environmentsIsolated environment per pull request, cleaned up on merge or closeRequires deploying the app on Laravel Cloud; client feedback happens elsewhere
Netlify / Vercel previewsGreat for static and JavaScript front endsNot built around a conventional PHP app with a database
PR-based preview tools (e.g. PullPreview, VeilStream)A full environment per pull requestNeeds Git and a PR workflow; built for developer reviewers, not client sign-off
Hosted review environment (Prev)Any machine with the CLI, built-in pinned feedback and approval, auto-expirySingle HTTP port; no queue workers or multi-service setups

If your production already runs on Laravel Cloud, its preview environments are a strong default for pull-request testing. Prev fits when you want a review link from your terminal or CI, independent of where production lives, and when the client conversation itself, comments and approval, should live on the preview. For client work, the deciding question is often simpler: does the person approving need to touch Git at all? With Prev, they don’t, and neither do you.

Launching a Laravel review environment with Prev

Prev's CLI detects project types automatically. A directory with a composer.json is treated as a PHP project and served on an Apache/PHP runtime on port 80. Composer dependencies are installed for you (without dev packages), and when the project has a public/ folder, that folder becomes the document root, which is exactly Laravel's layout. Install the CLI, set your API key, and run one command from the project root:

curl -fsSL https://prev.sh/install.sh | sh
export PREV_API_KEY="your-api-key-here"
prev create . --feedback --subdomain acme-portal

The CLI packages the project, the platform builds a Docker image, deploys it and returns an HTTPS URL. With --feedback, the preview gets a review sidebar: your client enters a name, pins comments to page elements, and requests changes or approves. No account and no installation on their side.

That default image serves files that exist on disk. It does not enable mod_rewrite, and the CLI does not upload hidden files, including public/.htaccess. / can reach public/index.php. A Laravel route such as /login does not, and Apache returns 404. For those routes, publish an image that sends missing paths to the front controller. public/build inside that image is fine: the CLI's build exclusion applies to source uploads, not to files already copied into the image.

Your client will click past the home page, so for a client review the published image below is the realistic default.

FROM composer:2 AS composer
FROM php:8.3-apache
RUN apt-get update && apt-get install -y git unzip && rm -rf /var/lib/apt/lists/* \
 && docker-php-ext-install pdo pdo_mysql mysqli \
 && printf '<Directory /var/www/html/public>\nFallbackResource /index.php\n</Directory>\n' > /etc/apache2/conf-available/laravel.conf \
 && a2enconf laravel
COPY --from=composer /usr/bin/composer /usr/bin/composer
COPY . /var/www/html
WORKDIR /var/www/html
RUN composer install --no-dev --no-interaction --optimize-autoloader \
 && sed -ri 's!/var/www/html!/var/www/html/public!g' /etc/apache2/sites-available/*.conf /etc/apache2/apache2.conf \
 && chown -R www-data:www-data /var/www/html
EXPOSE 80
CMD ["apache2-foreground"]
docker build -t registry.example.com/your-app:latest .
docker push registry.example.com/your-app:latest
prev create --image registry.example.com/your-app:latest --port 80 --feedback

Each new review round for an image deployment means publishing a new image and creating a new preview. prev create --to updates a source deploy only, and it does not change an image deploy. Creating another preview with the same subdomain is rejected while that preview is still active.

If your app uses Vite and you stay on the source deploy, do not rely on the default public/build output. The CLI skips every directory named build, and the PHP image does not run npm, so npm run build alone never reaches the preview. Set Laravel's Vite buildDirectory to a folder that is not named build, such as assets, run npm run build, then deploy. That still does not add rewrite rules. Use the published image above when routes other than / must work.

With --exec, Prev switches to php:8.3-cli, does not run composer install, and does not use public/ as the document root. The CLI also omits every vendor directory from the upload, so php artisan serve cannot see vendor/autoload.php. Use the default Apache image for a file that exists on disk, or the published image above for Laravel routes.

Need two sign-offs, for example the client and your QA lead? Define approval slots. Prev returns a slot-specific "magic" review link for each, and the review only counts as approved when every slot has approved the current round.

prev create . --feedback --approval-slots client,qa

Databases, env vars and migrations

Environment variables: Prev reads a .env file from the project root automatically for local deployments. To avoid shipping local secrets, keep a dedicated file and pass it explicitly with --env-file .env.preview, or set single values with -e. Remember that Laravel needs an APP_KEY.

Databases: on Individual and Teams you can attach a managed PostgreSQL, MariaDB or MongoDB database with --db. Agency includes 1 managed database, with more available as add-ons. Prev injects one DATABASE_URL variable and never exposes the raw credentials. Check which variable your config/database.php reads; recent Laravel skeletons use DB_URL, older ones DATABASE_URL. One line covers both:

'url' => env('DB_URL', env('DATABASE_URL')),

Seed data: the dashboard includes a database admin that can browse tables, run SQL and import or export data, which is handy for loading demo content. Managed databases are backed up daily with 7-day retention and have a 1 GB soft limit.

Migrations: the default runtime serves the app without a custom boot step and does not run php artisan migrate. Apply the schema through the dashboard's SQL tool, or run the migration from your own published image entrypoint. --exec is not a way to install Composer dependencies first. Keep the command idempotent, since an in-place update rebuilds the image from scratch.

Automating previews per pull request

Prev's docs include a GitHub Actions workflow that creates a feedback-enabled preview for every pull request, named after the PR number:

name: Deploy Preview
on:
  pull_request:
    types: [opened, synchronize]
jobs:
  preview:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Install prev
        run: curl -fsSL https://prev.sh/install.sh | sh
      - name: Create preview
        if: github.event.action == 'opened'
        run: prev create . --feedback --subdomain pr-${{ github.event.number }}
        env:
          PREV_API_KEY: ${{ secrets.PREV_API_KEY }}
      - name: Update preview
        if: github.event.action == 'synchronize'
        run: prev create --to pr-${{ github.event.number }} .
        env:
          PREV_API_KEY: ${{ secrets.PREV_API_KEY }}

Creating again with the same subdomain while that preview is still active returns a conflict. opened creates the preview. synchronize updates it with --to. If the preview has already expired, the update has nothing to attach to and you create it again. For a later round on a link you chose yourself, prev create --to acme-portal . deploys new code to the same URL. With feedback enabled, a successful update starts a new review round: earlier approvals no longer count, and previous change requests stay visible. On Teams, feedback notifications can be routed to Slack, Discord, Microsoft Teams, Google Chat, email or a webhook with --notify on the create that enables feedback. --notify has no effect without --feedback, and an in-place update keeps the notification profile already stored on the preview.

Limits to know

  • Prev runs self-contained web apps and Docker images that expose one HTTP port.
  • Multi-service orchestration, long-running workers (such as queue workers) and production-like shared data may need dedicated staging.
  • Preview lifetime: up to 3 days on Free, 7 days on Individual, 14 days on Teams.
  • Capacity: 1 active preview on Free, 8 on Individual, 20 on Teams (expandable on paid plans).
  • Password protection needs Individual, Agency, or Teams; IP allowlists need Teams.
  • Prev hosts review environments, not production.

Launch your first Laravel review free. One active preview, up to 3 days, no credit card required.

FAQ

Do I need Git or a pull request?

No. Run the CLI from the project root; Git, FTP, SSH, and CI are optional ways in.

Does Prev detect Laravel automatically?

Yes: a composer.json is detected as a PHP project, served on port 80 with public/ as the document root, so prev create . --feedback is usually all you need. A published Docker image is the path for a custom start command. --exec switches to a PHP CLI image that does not install Composer dependencies, and the upload omits vendor, so it does not start Laravel.

Can I attach a database to a Laravel preview?

Yes, on Individual and Teams: managed PostgreSQL, MariaDB or MongoDB via --db, exposed to the app as DATABASE_URL. Agency includes 1 managed database, with more available as add-ons.

Will queue workers run?

Long-running workers may need dedicated staging. Prev targets apps that expose one HTTP port.

Does my client need an account?

No. They open the HTTPS link, add a name, comment and approve.

How is this different from Laravel Cloud preview environments?

Laravel Cloud creates previews for apps deployed on Laravel Cloud, per pull request. Prev launches a review link from any terminal or CI and adds pinned client feedback and approvals on the preview.

Further reading