Laravel Cloud Preview Environments &amp; Scale to Zero | Mohamed Said        [  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MH.png)   Mohamed Said Laravel Backend Engineer  ](https://msaied.com) [ Home ](https://msaied.com) [ Projects ](https://msaied.com/projects) [ Articles  ](https://msaied.com/articles) [ Certificates ](https://msaied.com/certificates) [ Contact ](https://msaied.com#contact-section) 

       [  ](https://github.com/EG-Mohamed)       

 [ Home ](https://msaied.com) [ Projects ](https://msaied.com/projects) [ Articles ](https://msaied.com/articles) [ Certificates ](https://msaied.com/certificates) [ Contact ](https://msaied.com#contact-section) 

  [ home ](https://msaied.com)    [ articles ](https://msaied.com/articles)    Preview Environments and Scale to Zero on Laravel Cloud: Better Together        On this page       1. [  The Problem: "Can I Try It?" ](#the-problem-quotcan-i-try-itquot)
2. [  A Working Application in Every Pull Request ](#a-working-application-in-every-pull-request)
3. [  Let Idle Previews Sleep with Scale to Zero ](#let-idle-previews-sleep-with-scale-to-zero)
4. [  Test Closer to Production ](#test-closer-to-production)
5. [  Give Experiments Their Own Space ](#give-experiments-their-own-space)
6. [  A Representative Stack, Isolated by Default ](#a-representative-stack-isolated-by-default)
7. [  Key Takeaways ](#key-takeaways)

  ![Preview Environments and Scale to Zero on Laravel Cloud: Better Together](https://cdn.msaied.com/714/64d9ff6237e2f6260fc4bcebb274edfa.png)

 [  Laravel ](https://msaied.com/articles?category=laravel)  #Laravel Cloud   #Preview Environments   #Scale to Zero   #CI/CD   #Pull Requests   #Deployment  

 Preview Environments and Scale to Zero on Laravel Cloud: Better Together 
==========================================================================

     28 Sep 2026      4 min read    ![Mohamed Said](https://cdn.msaied.com/01M22N44A70A5MC2S599JP0MPH.webp)  Mohamed Said  

       Table of contents

1. [  01   The Problem: "Can I Try It?"  ](#the-problem-quotcan-i-try-itquot)
2. [  02   A Working Application in Every Pull Request  ](#a-working-application-in-every-pull-request)
3. [  03   Let Idle Previews Sleep with Scale to Zero  ](#let-idle-previews-sleep-with-scale-to-zero)
4. [  04   Test Closer to Production  ](#test-closer-to-production)
5. [  05   Give Experiments Their Own Space  ](#give-experiments-their-own-space)
6. [  06   A Representative Stack, Isolated by Default  ](#a-representative-stack-isolated-by-default)
7. [  07   Key Takeaways  ](#key-takeaways)

 The Problem: "Can I Try It?"
----------------------------

Code is ready, tests pass, and then someone asks: *"Can I try it?"* Staging is occupied, the reviewer can't run the project locally, and a screen recording just isn't the same as clicking through the real thing.

Laravel Cloud's **preview environments** solve this with a single answer: here's a link.

A Working Application in Every Pull Request
-------------------------------------------

Once you configure an automation under **Settings → Preview environments**, opening a pull request against your target branch automatically:

- Provisions a dedicated environment with a unique URL
- Posts that URL directly to the pull request
- Redeploys on every new commit
- Cleans up resources when the PR is merged or closed

The place where you discuss a change also contains a working version of it. A designer can review the interaction, a client can confirm the feature meets their need, and a QA engineer can run through the full flow—all without touching staging.

Let Idle Previews Sleep with Scale to Zero
------------------------------------------

The obvious concern is cost. A preview might need application compute, a database, a cache, and background workers. Multiply that across several open pull requests and it sounds expensive.

In practice, previews spend most of their time waiting. A reviewer spends 15 minutes on a change, leaves a comment, and moves on. The developer picks it up after lunch. [Scale to zero](https://laravel.com/cloud/docs/compute#scale-to-zero) is a perfect match for this pattern—resources sleep when idle and wake on demand.

The numbers from the official announcement illustrate just how affordable this is:

| Preview branch | Active lifetime | Estimated cost (USD) | |-------------------|-----------------|----------------------| | feature/checkout | 10 minutes | ≈ $0.0033 | | feature/account | 1 hour 30 min | ≈ $0.0298 | | feature/emails | 2 hours 20 min | ≈ $0.0463 | | **Total** | **4 hours** | **≈ $0.08** |

Laravel Cloud's preview defaults enable scale to zero wherever it is supported, so you get isolation without paying for idle time.

Test Closer to Production
-------------------------

A preview is a real deployment, not a mock. That means you can:

- Run browser tests (e.g., Laravel Dusk) against the preview URL
- Exercise third-party integrations with sandbox credentials
- Verify that build and deployment commands produce the expected result
- Catch configuration mistakes before they reach production

Requests travel over the public internet and your application talks to actual services—giving you a much more representative signal than a local environment.

Give Experiments Their Own Space
--------------------------------

Previews are also useful for exploring changes you haven't committed to yet. Want to evaluate [managed queues](https://laravel.com/blog/managed-queues-autoscaling-queue-workers-on-laravel-cloud)? Add the service to a preview, run representative jobs, inspect failures, and get comfortable with the configuration—all without touching production.

Because each preview is isolated, you can adjust its resources independently and answer practical questions with a running application.

A Representative Stack, Isolated by Default
-------------------------------------------

Preview environments are designed to mirror production resource types while remaining completely separate:

- **Dedicated database, cache, and queue** per preview
- **Independent environment variables** so production secrets stay out of previews
- **Scale to zero** enabled by default to keep costs minimal
- Option to share existing resources when appropriate (though keeping production databases separate is strongly recommended)

Key Takeaways
-------------

- Configure automations under **Settings → Preview environments** on your target environment.
- Each PR gets a unique URL, auto-updated on new commits, and cleaned up on merge/close.
- Scale to zero means an entire sprint's worth of open PRs can cost less than a dollar in compute.
- Previews support browser testing, integration testing, and safe experimentation with new services.
- Environment variables are scoped per automation, keeping production secrets isolated.

---

*Source: [Preview environments and scale to zero: Better together](https://laravel.com/blog/preview-environments-and-scale-to-zero-better-together) — Laravel Blog, Sep 28, 2026*

 Found this useful?

          [  ](https://twitter.com/intent/tweet?url=https%3A%2F%2Fmsaied.com%2Farticles%2Fpreview-environments-and-scale-to-zero-on-laravel-cloud-better-together&text=Preview+Environments+and+Scale+to+Zero+on+Laravel+Cloud%3A+Better+Together) [  ](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fmsaied.com%2Farticles%2Fpreview-environments-and-scale-to-zero-on-laravel-cloud-better-together) 

 Frequently Asked Questions 
----------------------------

  3 questions  

     Q01  How much does a Laravel Cloud preview environment cost with scale to zero enabled?        Very little. According to Laravel's own figures, three feature branches with a combined active lifetime of about four hours cost approximately $0.08 in total compute. Resources sleep when idle and only incur cost when actively serving traffic. 

      Q02  Are preview environment databases isolated from production?        Yes. By default, Laravel Cloud provisions dedicated resources—including databases and caches—for each preview environment. Laravel strongly recommends keeping production databases separate from previews to avoid affecting real data or triggering real actions. 

      Q03  How do I set up preview environments on Laravel Cloud?        Navigate to Settings → Preview environments on the environment you want to generate previews from. Create an automation, define your branch rules and resource settings, add required environment variables, and configure deployment and cleanup behavior. The official documentation covers all available options. 

  Continue reading

 More Articles 
---------------

 [ View all    ](https://msaied.com/articles) 

 [ ![Profiling Laravel with Blackfire and Xdebug: Finding Real Bottlenecks](https://cdn.msaied.com/712/7fd2cb3e1dda6c009d734cd376d14e36.png) laravel performance blackfire 

### Profiling Laravel with Blackfire and Xdebug: Finding Real Bottlenecks

Stop guessing where your Laravel app is slow. Learn how to use Blackfire and Xdebug profiling together to pinp...

  ![Mohamed Said](https://cdn.msaied.com/01M22N44A70A5MC2S599JP0MPH.webp)  Mohamed Said 

 28 Sep 2026     4 min read  

  Read    

 ](https://msaied.com/articles/profiling-laravel-with-blackfire-and-xdebug-finding-real-bottlenecks-2) [ ![Filament v5 Preview: What Is Changing and How to Prepare Your Codebase](https://cdn.msaied.com/711/0f685151a6c04b1c707230164839d12e.png) filament laravel filament-v5 

### Filament v5 Preview: What Is Changing and How to Prepare Your Codebase

Filament v5 is on the horizon with deeper PHP 8.3+ type safety, a revised plugin contract, and schema composit...

  ![Mohamed Said](https://cdn.msaied.com/01M22N44A70A5MC2S599JP0MPH.webp)  Mohamed Said 

 28 Sep 2026     4 min read  

  Read    

 ](https://msaied.com/articles/filament-v5-preview-what-is-changing-and-how-to-prepare-your-codebase-1) [ ![Tashil: Add Subscription Plans and Feature Usage Limits to Laravel](https://cdn.msaied.com/713/98c40d9d0472588d25d8b8359a96d1b1.png) Laravel Subscriptions SaaS 

### Tashil: Add Subscription Plans and Feature Usage Limits to Laravel

Tashil is a Laravel package that stores subscription plans in your database, tracks per-feature usage limits,...

  ![Mohamed Said](https://cdn.msaied.com/01M22N44A70A5MC2S599JP0MPH.webp)  Mohamed Said 

 28 Sep 2026     4 min read  

  Read    

 ](https://msaied.com/articles/tashil-add-subscription-plans-and-feature-usage-limits-to-laravel) 

   [  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MH.png)   Mohamed Said Laravel Backend Engineer  ](https://msaied.com)Senior Backend Engineer specializing in Laravel, scalable SaaS platforms, APIs, and cloud infrastructure. I build secure, high-performance web applications that help businesses grow.

Explore

- [Home](https://msaied.com)
- [Projects](https://msaied.com/projects)
- [Articles](https://msaied.com/articles)
- [Certificates](https://msaied.com/certificates)
- [Contact](https://msaied.com#contact-section)

Connect

- [   hello@msaied.com ](mailto:hello@msaied.com)
- [   +20 109 461 9204 ](tel:+201094619204)

© 2026 Mohamed Said. All rights reserved.

 [  ](https://github.com/EG-Mohamed) [  ](https://www.linkedin.com/in/msaiedm/) [  ](https://wa.me/201094619204) [  ](mailto:hello@msaied.com) [  ](https://drive.google.com/file/u/0/d/1MF20IPRJyzfy32mhEutjL5EpSls0w2Q8/view)
