Workers PHP
Laravel, running inside Cloudflare Workers.
PHP 8.5.2 in a V8 isolate, in every Cloudflare location.
- See how Laravel maps to Cloudflare
- Try the live demos
Laravel v13.25.0 on PHP 8.5.2, rendered inside a V8 isolate
Laravel, running inside Cloudflare Workers.
PHP 8.5.2 in a V8 isolate, in every Cloudflare location.
Laravel v13.25.0 on PHP 8.5.2, rendered inside a V8 isolate
Standard Laravel calls on the left. What actually runs them on the right.
Eloquent works unchanged. Queries run on D1, where writes are serialized.
$chirp = Chirp::create(['message' => $text]);
The kv store reads from Workers KV at the edge. The do store runs on Durable Object shards for atomic counters and locks.
Cache::store('kv')->remember('stats', 60, fn () => ...);
Cache::store('do')->increment('clicks');
Uploads store to R2. Downloads are served from the bucket without waking PHP. Try it: attach a photo to a chirp below.
$path = $request->file('photo')->store('photos', 'r2');
Jobs dispatch into Cloudflare Queues and run on a consumer, with native retries.
ProcessUpload::dispatch($chirp);
Events broadcast through a Durable Object speaking the Pusher protocol. Stock Laravel Echo connects to it.
broadcast(new ChirpCreated($chirp));
Echo.channel('chirps').listen('.chirp.created', ...);
Closures and queued jobs run on Cron Triggers.
Schedule::call(fn () => ...)->everyFifteenMinutes();
Cache::store('do')->increment()dispatch(new DemoJob)throttle:5,1 middlewareCache::store('kv')->remember(..., 60)Schedule::call() broadcast()
New posts appear without a refresh. Register and post one from another tab.
:0
yo
PHP <3 V8
| Interpreter | PHP 8.5.2 compiled to wasm with JSPI and native wasm exceptions. Cold start is about 1 second. |
| Filesystem | lazy zip-backed. The app is never extracted; files hydrate on first read. |
| Compile step | OPcache and Blade are pre-compiled at build time and shipped in the bundle. |
| Bindings | a single C function bridges PHP to KV, R2 and Durable Objects. |
| WebSockets | a Durable Object speaks the Pusher protocol, so stock Laravel Echo connects. |
Workers PHP is a community project. It is not affiliated with or endorsed by Cloudflare or Laravel. Everything on this page, including the HTML itself, was produced by PHP running in a V8 isolate.