PHPackages                             web-chefs/laravel-app-spawn - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. web-chefs/laravel-app-spawn

ActiveLibrary[Testing &amp; Quality](/categories/testing)

web-chefs/laravel-app-spawn
===========================

Laravel custom application instance bootstrap creator. Used predominantly for doing Laravel specific testing.

1.6(4y ago)05.4k↓71.4%2MITPHPPHP ^7.0|^8.0CI failing

Since Jun 5Pushed 4y ago3 watchersCompare

[ Source](https://github.com/web-chefs/LaraAppSpawn)[ Packagist](https://packagist.org/packages/web-chefs/laravel-app-spawn)[ Docs](https://github.com/web-chefs/LaraAppSpawn)[ RSS](/packages/web-chefs-laravel-app-spawn/feed)WikiDiscussions master Synced today

READMEChangelog (7)Dependencies (2)Versions (9)Used By (2)

LaraAppSpawn
============

[](#laraappspawn)

[![Latest Version on Packagist](https://camo.githubusercontent.com/743b87458955746441ef6c4250dbdddeca510fa6dc38d14040483dd2eec920a4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7765622d63686566732f6c61726176656c2d6170702d737061776e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/web-chefs/laravel-app-spawn)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/2367bb619d89533ab48c4cbefd063f9a22e7ccb4826d2da163a79ebe2e87d304/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7765622d63686566732f6c61726176656c2d6170702d737061776e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/web-chefs/laravel-app-spawn)

Laravel Custom Application Spawner is primarily used for creating a Application instance in a unit testing environment, allowing you to interact with Laravel in your tests.

By default it will use a SQLite in memory database, allowing you to run migrations and use a fully functional database during your tests.

It is up to you to migration and seed this test database.

Install
-------

[](#install)

**Via Composer**

```
$ composer require web-chefs/laravel-app-spawn --dev
```

Basic usage example
-------------------

[](#basic-usage-example)

```
use Illuminate\Foundation\Testing\TestCase;
use WebChefs\LaraAppSpawn\ApplicationResolver;

class MyTest extends TestCase
{
    /**
     * Creates the application.
     *
     * @return \Illuminate\Foundation\Application
     */
    public function createApplication()
    {
        // Root of my app, used as a fallback for location of /database when
        // database.path in config is null.
        $appRoutePath = __DIR__;

        // Resolve Application
        $resolver  = ApplicationResolver::makeApp($appRoutePath);
        $this->app = $resolver->app();

        // Run our database migrations if required
        $this->artisan('migrate:refresh', [ '--force' => 1 ]);

        return $this->app;
    }

}
```

Example with custom configs
---------------------------

[](#example-with-custom-configs)

```
use Illuminate\Support\Arr;
use Illuminate\Foundation\Testing\TestCase;
use WebChefs\LaraAppSpawn\ApplicationResolver;

class MyTest extends TestCase
{
    /**
     * Creates the application.
     *
     * @return \Illuminate\Foundation\Application
     */
    public function createApplication()
    {
        // Root of my app, used as a fallback for location of /database when
        // database.path in config is null.
        $appRoutePath = __DIR__;

        // Build Resolver config
        $config = ApplicationResolver::defaultConfig();
        Arr::set($config, 'database.connection', $this->connectionName);
        Arr::set($config, 'queue.connection', $this->connectionName);

        // Resolve Application
        $resolver  = ApplicationResolver::makeApp($appRoutePath, $config);
        $this->app = $resolver->app();

        // Run our database migrations if required
        $this->artisan('migrate:refresh', [ '--force' => 1 ]);

        return $this->app;
    }

}
```

TravisCI
--------

[](#travisci)

This was originally developed for `WebChefs\QueueButler` and for testing multiple version of Laravel using the same tests.

To see how that is possible see WebChefs\\QueueButler [.travis.yml](https://github.com/web-chefs/QueueButler/blob/master/.travis.yml).

Contributing
------------

[](#contributing)

All code submissions will only be evaluated and accepted as pull-requests. If you have any questions or find any bugs please feel free to open an issue.

Credits
-------

[](#credits)

- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~200 days

Recently: every ~301 days

Total

7

Last Release

1746d ago

PHP version history (3 changes)1.0PHP ~5.6|~7.0

1.5PHP ~7.0

1.6PHP ^7.0|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/e8247fd878aaf650727c999405f9aa95af762af658410752ef51f777ec296a7f?d=identicon)[web-chefs](/maintainers/web-chefs)

---

Top Contributors

[![JFossey](https://avatars.githubusercontent.com/u/4981545?v=4)](https://github.com/JFossey "JFossey (24 commits)")

---

Tags

configurationenvlaravelloggingphptestingtestlaravelloggingdatabasedebugging

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/web-chefs-laravel-app-spawn/health.svg)

```
[![Health](https://phpackages.com/badges/web-chefs-laravel-app-spawn/health.svg)](https://phpackages.com/packages/web-chefs-laravel-app-spawn)
```

###  Alternatives

[hotmeteor/spectator

Testing helpers for your OpenAPI spec

3051.6M1](/packages/hotmeteor-spectator)[guanguans/laravel-soar

SQL optimizer and rewriter for laravel. - laravel 的 SQL 优化器和重写器。

2248.4k](/packages/guanguans-laravel-soar)[ecotone/laravel

Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.

21318.6k3](/packages/ecotone-laravel)[sofa/eloquent-testsuite

Helpers for fast and reliable UNIT tests for your Eloquent Models with PHPUnit

10107.6k](/packages/sofa-eloquent-testsuite)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
