Download the PHP package yangusik/laravel-spawn without Composer

On this page you can find all versions of the php package yangusik/laravel-spawn. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-spawn

Laravel adapter for PHP TrueAsync — a PHP fork with a native coroutine scheduler and async I/O. Think Laravel Octane, but instead of Swoole or RoadRunner the runtime is TrueAsync.

One worker. Many requests. Zero threads. Each HTTP request runs in its own coroutine with isolated state — no shared memory, no leaks between requests.


How it works


Requirements


Installation

Via git repository:

Via local path:

Then run composer update.

The service provider is auto-discovered by Laravel.

Replace the Application class in bootstrap/app.php:

This is required for per-coroutine isolation of auth, session, and request. Without it the service adapters register correctly but state isolation does not work.

Publish the config:


Servers

True Async Server

Production-ready adapter using True Async Server in async worker mode.

Check config/async.php!

Dev server

Simple TCP socket server for local development. Analogous to php artisan serve.

FrankenPHP

Production-ready adapter using FrankenPHP in async worker mode. Requires the trueasync/php-true-async:latest-frankenphp Docker image.


Docker quick start

TrueAsyncServer (better)

Dev server

FrankenPHP


Configuration

config/async.php:

If you use TrueAsyncServer, pls read docs: Configuration


Benchmarks (Obsolete use TrueAsyncServer)

Check results in HttpArena

Load: 840 req/s /hello + 360 req/s /test = 1 200 req/s total · constant-arrival-rate · 30s · 12 workers each · WSL2 (Linux 6.6 on Windows)

Metric PHP-FPM (12w) Octane Swoole (12w) TrueAsync-Franken (12w)
Target rate 1 200 req/s 1 200 req/s 1 200 req/s
Actual throughput ~200 req/s ~752 req/s ~1 118 req/s
Dropped iterations ~28 000 ~5 000 20
Avg latency ~4 000ms ~880ms 13ms
p95 latency ~5 000ms 2 320ms 21ms
p95 < 200ms
Failed requests 0% 0% 0%
DB connections (peak) 120

Why TrueAsync wins on DB-bound load

PHP-FPM Octane Swoole TrueAsync-Franken
Request model Process per request 1 process = 1 request at a time 1 worker = N coroutines
DB I/O Blocking (new conn each req) Blocking (PDO synchronous) Non-blocking (coroutine yield)
Memory model Stateless Long-lived process Long-lived process + coroutine context isolation
App bootstrap Every request Once per worker Once per worker

Swoole keeps the app in memory (avoids bootstrap cost) but PDO is still synchronous — a worker blocked on a DB call cannot accept another request. TrueAsync yields the coroutine on every DB call, so one worker handles hundreds of concurrent DB-bound requests without blocking.

Notes

Full benchmark: ta_benchmark

Raw PHP — TrueAsync vs Swoole (no framework, no I/O)

On pure CPU-bound workloads both servers cap at the same throughput (~10k req/s). With optimal Swoole config (ZTS, 16 reactor threads) Swoole is ~1.6x faster on P95 latency due to FrankenPHP's Go↔PHP boundary overhead (futex synchronization). On I/O-bound workloads this overhead is negligible.


Sessions

Database sessions (built-in fix)

The package automatically replaces Laravel's DatabaseSessionHandler with an async-safe version that uses upsert instead of INSERT + catch + UPDATE.

In a standard async server the HTTP response is sent before kernel->terminate() writes the session. If the client immediately sends the next request with the same cookie, two coroutines can race to INSERT the same session ID — causing duplicate-key warnings in the stock handler. The upsert is atomic, so this race is impossible regardless of concurrency.

No configuration needed. Works transparently when SESSION_DRIVER=database.

Redis sessions (recommended for production)

For high-concurrency workloads Redis sessions have lower overhead than database sessions and avoid any persistence race entirely:


License

MIT


All versions of laravel-spawn with dependencies

PHP Build Version
Package Version
Requires php Version ^8.6
laravel/framework Version ^12.0 || ^13.0
ext-pcntl Version *
ext-pdo Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package yangusik/laravel-spawn contains the following files

Loading the files please wait ...