Laravel Snippets is a static rendering of the Laravel 13.x documentation where every PHP code block is runnable. PHP 8.5 boots inside a web worker, loads a Laravel 13 bundle, and executes each example directly in your browser. No server runs any code.
To try it right away, head over to this link.
Laravel Snippets is a demonstration of what PHP.wasm snippets can do, not an official Laravel resource. Many thanks to the Laravel team for their outstanding work and documentation.
The Laravel documentation is a pleasure to read, and it is full of code. But that code sits still. You read ->groupBy(), you picture the shape of the result, and to actually see it you copy the example into a project, adapt it, run it, and only then find out whether your mental picture was right. Between the paragraph and the answer there is a whole round trip.
Two years ago, Run Laravel on your browser with Browser PHP asked how a PHP script could run on the client side. Laravel Snippets is the same question asked again, on a page you already visit every week : what if every example ran where you read it?
Every example runs
Each php fence of the documentation becomes a snippet with a Run button. The output appears under the code, with the colours of dump() and the framework's own error formatting preserved. The first run boots PHP and every run after that is immediate.
Snippets are editable
The code block is editable in place. Change a value, add a ->map(), run it again, and press reset to return to the documentation's version. The example becomes a small sandbox without leaving the page.
A real Laravel underneath
The worker unzips a Laravel 13 framework bundle at boot, so Illuminate\Support\Collection, dump(), Lang::get() and their friends resolve as they would in a project. The bundle also carries a set of models User, Post, Flight, Order because the documentation refers to them constantly and an example that cannot resolve App\Models\User cannot run.
Always current
Laravel Snippets follows the documentation instead of freezing a copy of it. A scheduled workflow mirrors the upstream laravel/docs markdown repository every day. A second one fetches Laravel compiled CSS and fonts every day, so the pages keep the typography of the original. Each successful sync republishes the static site on GitHub Pages.
The report
Once every example is runnable, a second question follows on its own : how many of them actually run?
A workflow answers it. Playwright boots each prerendered page, runs every snippet through the PHP.wasm worker, and records the outcome in one of six buckets: ran-ok, ran-with-stderr, ran-exit-nonzero, worker-error, no-output, never-completed. The sweep runs weekly, and again whenever the runtime or the markdown sources change. The report shows the totals, a per-page rollup, and every single snippet with its input and its output.
Two thirds run clean. The remaining third deserves a warning, because a red cell is not a bug in the documentation. There is no database behind the browser, no Stripe key, no Sanctum, no Pennant. And a large share of the code in the documentation was never meant to run at all : a configuration array, a class body without its class. Those blocks fail by design.
Getting started
There is nothing to install.
Check out the Github repository or open the live demo.
Pick a page in the sidebar.
Press Run on any snippet.
Edit the code and run it again.
Open the report to see what currently fails, and where.