The complete guide to Laravel Rust
By Flavio
Tagged: Laravel
Learn Laravel Rust from scratch: install the new Laravel CLI, build a real uptime monitor with Axum, Tokio, typed models, validation, queues, durable workflows, Reverb WebSockets, Inertia v3, tests, and deploy on Laravel Cloud.
Laravel just released Laravel Rust in public beta, and it is one of the biggest shifts I have seen in web development in years.
For 15 years, people treated Laravel as “a PHP thing”. PHP has come a long way, and I still respect what modern PHP 8 can do, but PHP has never shaken its reputation problem. A lot of developers and teams simply skip Laravel the moment they hear the word PHP.
Rust has the opposite reputation. It is the language ambitious teams reach for when they care about speed, memory safety, and strict compiler checks. The catch with Rust on the web has always been ergonomics. If you start a web app with popular Rust HTTP frameworks like Axum or Actix Web (which give you routing and request handling, similar to Express or Hono in JavaScript), you spend your first week stitching together an ORM, migrations, authentication, sessions, queues, email, validation, and tests by hand.
Laravel Rust puts those two halves together. You get Rust’s speed and compiler guarantees paired with Laravel’s batteries-included conventions, clean APIs, and one-command workflow.
In Laravel’s own benchmarks, Laravel Rust handled 1,774 requests per second on the same server where Laravel PHP handled 97.
That’s 18x the throughput on a single box, using a fraction of the CPU and memory.
Sam Rose summed up the mood in his launch post on X: most web developers have not yet wrapped their heads around how much this changes.
Honestly, once Laravel Rust settles past its initial beta period, I have a hard time seeing myself starting a new Laravel project in PHP ever again.
It needs a few weeks to iron out rough edges and catch up on a couple of remaining gaps, and after that the sky is the limit.
Laravel PHP is still great and completely valid. The Laravel team made it clear they will keep maintaining and developing Laravel PHP in parallel, with weekly releases and new tools shipping for it. If you want to learn or keep building with the PHP version, my Laravel PHP guide and free Laravel Handbook are still a great place to start.
In this guide we will cover everything that launched today in the Laravel keynote and blog announcements: the framework itself, the benchmark numbers, the new Laravel Cloud multi-framework platform, the agentic tools (built-in Agent Skills, Cloud MCP, Converse, Agent Kit, and Model Gateway), and the tradeoffs you should know before switching.
To keep things concrete, we’ll build a real Laravel Rust application together, from an empty folder.
We’ll build Pingwatch, an endpoint uptime monitor with SQLite migrations, typed models, validated JSON and Inertia forms, background check jobs, real-time WebSocket broadcasts, a durable outage escalation workflow, custom CLI commands, and automated integration tests.
Every command, output, benchmark number and screenshot below comes from running Pingwatch locally on Laravel for Rust 0.1.3 and rustc 1.100.1.
Why Laravel Rust matters right now
Taylor Otwell explained the reason behind this decision in his letter to the Laravel community.
Laravel was created 15 years ago to make hand-writing web applications pleasant.
Interpreted languages like PHP, Ruby, and Python traded runtime speed so humans could type less boilerplate and move faster.
Now, coding agents write a huge portion of our code, and Taylor mentioned in the launch posts that he has not written a line of code by hand in the past year.
In fact, he built Laravel Rust in 2 months using cloud agents heavily, while hand-curating every API surface and every page of documentation.
That changes the tradeoff, because when an agent writes and refactors the code, paying a permanent 18x runtime tax just to avoid Rust’s type annotations stops making sense.
Why do we still need a framework when AI writes the code?
Right after the launch, Tobias Petry asked a sharp question on X: if coding agents can now write code in any language we don’t even know, why do we need Laravel Rust at all instead of letting an agent build everything from scratch?
I think about this the same way I think about Astro. I use Astro for all of my sites, even though coding agents write a big part of the code for me now.
Astro gives every site a clear structure, keeps the project simple and manageable months later, and I know how it works. When something breaks or I want to add a feature, I know where the routes, layouts, and content live instead of reverse-engineering whatever custom setup an agent invented from scratch.
On the backend, the stakes are even higher. Authentication, CSRF protection, encrypted sessions, password hashing, database migrations, and queue retries have to be right every time. Asking an agent to rebuild those pieces from scratch on every new app burns tokens and invites subtle security bugs you only notice in production.
With Laravel Rust, you build on an open-source foundation maintained by people you trust, with a full set of tested tools already wired together. Every app shares the same layout and conventions, which is the same reason Laravel became so successful in the first place.
A strict compiler plus batteries-included conventions is the sweet spot for both humans and coding agents. The framework gives everyone one obvious place to put routes, models, migrations, jobs, and tests, and the Rust compiler rejects broken queries, missing authorization checks, and leaked password hashes before the binary ever builds.
What happens when your app calls a slow database query, a third-party webhook, or an LLM API that takes 4 seconds to reply?
In traditional PHP, a worker is blocked waiting for the response.
In Laravel Rust, the entire stack is built on Tokio and Axum. Tokio is Rust’s standard async runtime (the event-loop engine that lets a handful of threads juggle thousands of network connections and background tasks at once), and Axum is the web routing and HTTP server layer built on top of it.
Because of that foundation, HTTP handlers, database queries (powered by SQLx, Rust’s async SQL library), Redis, queues, S3, and WebSockets are all non-blocking.
CPU-heavy work like bcrypt hashing runs on Tokio’s blocking pool, so it never blocks active connections.
The numbers: official benchmarks and local measurements
Before we write code, let’s look at the real numbers from Laravel’s 2026 six-framework benchmark (the source code and k6 scripts are public in laravel/laravel-framework-benchmarking-2026).
Sam Rose deployed the same simple 2-endpoint API backed by MySQL on identical Pro 4 GiB instances on Laravel Cloud in Canada Central, and ramped load from 1 to 2,000 requests per second over 20 minutes using k6. He also measured steady 50 RPS load, 100 cold Cloud builds per framework, local M4 Pro builds, and 5,400 scale-to-zero wake-ups across 9 regions.
| Framework | Peak RPS (0 errors) | p50 / p99 latency at peak | CPU at 50 RPS | RAM at 50 RPS | Median wake-from-sleep | Median Cloud cold build |
|---|---|---|---|---|---|---|
| Laravel Rust | 1,774 | 65 ms / 137 ms | 4.2% | 16 MB | 154 ms | 3m 1s |
| Rocket (Rust) | 1,623 | 110 ms / 213 ms | 4.4% | 11 MB | 156 ms | 2m 10s |
| Beego (Go) | 1,596 | 275 ms / 940 ms | 5.2% | 18 MB | 154 ms | 1m 6s |
| Rails (Ruby) | 253 | 121 ms / 283 ms | 20.5% | 119 MB | 259 ms | 53s |
| Django (Python) | 183 | 689 ms / 987 ms | 28.1% | 111 MB | 350 ms | 37s |
| Laravel PHP | 97 | 1,995 ms / 2,707 ms | 52.4% | 134 MB | 712 ms | 27s |
Click through the chart below to compare throughput, steady-state CPU, scale-to-zero wake times and cold build times of all the 6 frameworks:
Two things jump out from that table.
First, Laravel Rust did not just beat the interpreted frameworks by an order of magnitude. It beat Rocket (a lightweight Rust web framework) in peak throughput and tail latency, while shipping a full ORM, sessions, queues and middleware. At a steady 50 requests per second, it used 4.2% CPU and 16 MB of RAM, while Laravel PHP used 52.4% CPU and 134 MB. On scale-to-zero hosting, it woke up in a median 154 ms (257 ms at p95) vs 712 ms (886 ms at p95) for PHP.
Second, you do pay a real cost at deploy time. A cold Cloud build took a median 3 minutes and 1 second for Laravel Rust vs 27 seconds for Laravel PHP. Rust is doing type checking, borrow checking, macro expansion and LLVM optimization on every clean release build.
Locally, though, the loop feels much tighter than people expect from Rust. In Laravel’s M4 Pro tests, incremental dev rebuilds took a median 1.1 seconds (faster than Rocket at 1.7s and Beego at 1.8s).
When I built and ran our Pingwatch app locally on my Mac, here is what I measured directly:
- First-ever
laravel new pingwatch --rust(downloading crates,npm install, cold debug compile): 2m 14s - Incremental
cargo testrebuild after editing Rust handlers and tests: 1.22s to 1.92s - Running all 6 full-stack HTTP + SQLite + workflow tests in
tests/monitors.rs: 0.01s to 0.10s - Frontend
npm run buildwith Vite Plus: 293 ms - Full optimized
cargo build --release(SQLite + Reverb + Inertia + migrations compiled in): 54.98s - Final standalone binary size (
target/release/pingwatch): 43 MB - Release server idle memory: 22.3 MB RSS
- Local
GET /api/monitorsload test (2,000 requests across 32 threads hitting 3 concurrent SQLite queries): 6,019 RPS, p50 4.74 ms, p99 11.30 ms, 37.4 MB RSS
That single 43 MB binary holds your web server, your queue worker, your scheduler, your console commands, and your database migrations.
You do not install PHP, Composer, or vendor/ on the server.
Installing the Laravel CLI and creating your first app
Laravel Rust requires Rust 1.99 or later, Node.js (22.18+ or 24.11+) and Git.
If you don’t have Rust installed yet, install it with rustup or run rustup update to get a current toolchain.
rustc --version
# rustc 1.100.1 (20ddd0171 2026-11-25)
Next, install the new unified Laravel CLI.
It creates both PHP and Rust applications and runs your project’s console commands, replacing php artisan for Rust apps.
curl -fsSL https://laravel.com/install.sh | sh
On Windows, run this in PowerShell instead:
powershell -ExecutionPolicy Bypass -c "irm https://laravel.com/install.ps1 | iex"
The installer will put the laravel binary in ~/.laravel/bin and will add it to your shell profile.
Open a new terminal, and check the version:
laravel --version
# Laravel CLI 0.3.0
Be careful with a common PATH conflict if you already use Laravel Herd or the older Composer laravel/installer package.
Run which -a laravel on macOS or Linux.
If Herd’s laravel binary is listed first, move ~/.laravel/bin below Herd’s PATH line in ~/.zshrc so the new CLI takes precedence.
Now let’s create our Pingwatch application. Pass --rust to skip the language prompt:
laravel new pingwatch --rust
cd pingwatch
The CLI will download the laravel/rust skeleton, generate an APP_KEY in .env, install the React 19 + Inertia v3 + Tailwind CSS v4 + Vite Plus frontend dependencies, and run the first Cargo compile so that commands work out of the box.
Here is the full installation and project scaffolding running on a clean Ubuntu 24.04 container:

Understanding the directory structure
If you have ever worked in Laravel PHP (or read my Laravel Handbook), the layout will be very familiar.
Every piece has its place:
pingwatch/
├── .agents/skills/ # 7 built-in Agent Skills for coding agents
├── AGENTS.md # Project conventions for AI coding agents
├── CLAUDE.md # Points Claude Code straight to @AGENTS.md
├── Cargo.toml # Dependencies and laravel-rust Cargo features
├── build.rs # Rebuilds when new migrations are added
├── database/
│ ├── migrations/ # Forward-only Rust migrations compiled into binary
│ └── seeders/
├── resources/
│ ├── css/app.css # Tailwind CSS v4 entry point
│ ├── js/pages/ # Inertia v3 React + TypeScript page components
│ └── views/app.html # Root HTML document
├── src/
│ ├── app.rs # Application::configure() (routes, auth, middleware)
│ ├── main.rs # Runs web server or console command
│ ├── lib.rs # Declares app modules (library name is always `app`)
│ ├── testing.rs # Test harness overrides + refresh_database()
│ ├── config/ # Database, CORS, and custom config sections
│ ├── console/ # Commands and #[schedule::tasks]
│ ├── events/ # Events and broadcast payloads
│ ├── http/
│ │ ├── handlers/ # Resource handlers (instead of PHP Controllers)
│ │ └── middleware/ # HandleInertiaRequests and custom middleware
│ ├── listeners/ # #[listener] functions
│ ├── models/ # #[model] structs, colocated factories & policies
│ └── routes/ # web.rs, api.rs, channels.rs
└── tests/ # #[laravel::test] integration test crates
There are 2 subtle differences with PHP.
First, your crate [lib] name in Cargo.toml will always be app even if you rename the package, so tests will always import use app::models::Monitor.
Second, Rust will only compile modules that you declare in src/lib.rs (and in each folder mod.rs).
Once a module is declared, Laravel automatically discovers commands, jobs, workflows, listeners, config sections, and schedules by their attributes, without you having to register them in src/app.rs.
Here is the finished Pingwatch codebase open in Zed so you can see the folder structure alongside the typed handler code:

Picking your database driver with Cargo features
Laravel Rust is built on SQLx and supports PostgreSQL, MySQL, MariaDB and SQLite. Each driver is a Cargo feature on laravel-rust, so your final binary will only compile the drivers you actually use.
New apps default to database-postgres. To keep Pingwatch zero-config locally, let’s switch Cargo.toml to SQLite and enable the built-in local reverb WebSocket server at the same time:
# Cargo.toml
[dependencies]
laravel-rust = { version = "0.1", features = ["database-sqlite", "reverb"] }
mimalloc = "0.1"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
thiserror = "2"
tokio = { version = "1", features = ["fs", "io-util", "macros"] }
tracing = "0.1"
Then update the database lines in .env. Adding ?mode=rwc tells SQLite to create the database file automatically on first connection:
APP_NAME=Pingwatch
APP_URL=http://127.0.0.1:8000
DB_CONNECTION=sqlite
DATABASE_URL=sqlite://storage/app/database.sqlite?mode=rwc
If you want to learn SQLite concurrency tuning or PostgreSQL indexing in depth along with this tutorial, grab the free SQLite Handbook or PostgreSQL Handbook.
Now run your initial migrations and list every command available in the app:
laravel migrate
laravel list
Running laravel migrate will create users, sessions, cache, cache_locks, jobs, failed_jobs and the job batch tables in seconds:
Migrating `0001_01_01_000000_create_users_table`...
Migrating `0001_01_01_000001_create_cache_table`...
Migrating `0001_01_01_000002_create_jobs_table`...
3 migrations ran.
To run the local development environment (Rust server with auto-rebuild, queue worker, and Vite Plus hot reloading all in one terminal), run:
laravel dev
Visit http://127.0.0.1:8000 and you will see the default welcome page with its animated WebGPU particle terrain:

Edit a Rust file or .env and the server recompiles and restarts.
Edit a React component or Tailwind class and Vite updates the browser immediately.
Inside the request lifecycle and routing
Every Laravel Rust application starts from src/app.rs.
Instead of having the config spread across 10 service providers, Application::configure() lets you wire your compiled migrations, authentication guard, routes and middleware in one readable chain:
// src/app.rs
use laravel::foundation::ApplicationBuilder;
use laravel::{Application, inertia, model};
use crate::http::middleware::{HandleInertiaRequests, example_middleware};
use crate::models::User;
use crate::routes;
pub fn configure() -> ApplicationBuilder {
Application::configure()
.with_migrations(laravel::db::migrations!("database/migrations"))
.with_schema(laravel::db::schema!("database/schema"))
.with_auth(|auth, _| {
auth.session::<model::Users<User>>();
})
.with_routing(|routing, _| {
routing
.web(routes::web::routes)
.api(routes::api::routes)
.channels(routes::channels::routes)
.health("/up");
})
.with_middleware(|middleware, _| {
middleware.web(|web| {
web.append(inertia::middleware(HandleInertiaRequests))
.append(example_middleware);
});
})
}
When the binary starts, Laravel boots once before serving its first request.
It reads .env, runs config files, checks for conflicting routes or invalid env variables, and shares services across requests.
Let’s see what happens when a POST /api/monitors request comes in.
Click through the 4 steps below:
Routes live in src/routes/web.rs and src/routes/api.rs.
Web routes have sessions, encrypted cookies, CSRF verification, and Inertia middleware.
API routes are stateless and automatically prefixed with /api.
Here are the routes for Pingwatch. We will expose an Inertia dashboard on /monitors and a JSON API under /api/monitors:
// src/routes/web.rs
use laravel::prelude::*;
use crate::http::handlers::{monitors, welcome};
pub fn routes(route: &mut Router) {
route.get("/", welcome::show);
route.get("/monitors", monitors::index);
route.post("/monitors", monitors::store_web);
route.fallback(async || laravel::abort(404));
}
And the stateless JSON API routes:
// src/routes/api.rs
use laravel::prelude::*;
use serde_json::json;
use crate::http::handlers::monitors;
pub fn routes(route: &mut Router) {
route.get("/version", async || Json(json!({ "laravel": laravel::VERSION })));
route.get("/monitors", monitors::api_index);
route.post("/monitors", monitors::api_store);
route.get("/monitors/{monitor}", monitors::api_show);
route.patch("/monitors/{monitor}", monitors::api_update);
route.delete("/monitors/{monitor}", monitors::api_destroy);
}
Look at /monitors/{monitor} and how URL generation works in Laravel Rust:
- Route model binding is automatic. When a handler takes
monitor: Monitor, Laravel loads the matching row frommonitorsby primary key (or a custom column like{monitor:slug}) and returns404automatically if the row does not exist or the ID is not an integer. - URLs are checked at compile time. Instead of string route names that break silently when you rename a route, you pass the handler function directly to
route!(monitors::api_show, &monitor)orredirect!(monitors::index). If you rename or delete a handler, the build fails immediately. - Health checks are built in.
.health("/up")returns200 OKas soon as the app is ready for traffic, with no extra boilerplate.
Migrations, models, and relationships
In Laravel Rust, migrations are Rust files in database/migrations/ that are compiled into the application binary.
When you deploy to a server, you run ./pingwatch migrate --force and you don’t need to copy any source files.
Let’s generate 3 migrations for Pingwatch: our monitors table, our checks history table, and the 5 tables needed by durable workflows.
laravel make:migration create_monitors_table
laravel make:migration create_checks_table
laravel make:migration create_workflow_tables
Notice one opinionated design choice: migrations are forward-only. There is no down() method or rollback command, because dropping columns in production usually risks losing live data. If you need to undo a change on a live database, you write a new forward migration. On PostgreSQL and SQLite, Laravel wraps each migrate function inside a transaction automatically, so a failed migration rolls back cleanly.
Here is our monitors table migration using the fluent schema builder:
// database/migrations/2026_12_01_210550_create_monitors_table.rs
use laravel::db::AnyTransaction;
pub async fn migrate(tx: &mut AnyTransaction<'_>) -> laravel::Result<()> {
tx.schema()
.create("monitors", |table| {
table.id();
table.string("name").length(120);
table.string("url").unique();
table.integer("interval_seconds").default(60);
table.string("status").length(16).default("up");
table.integer("last_latency_ms").nullable();
table.timestamp("last_checked_at").nullable();
table.timestamps();
})
.await
}
And the checks table with a cascading foreign key and a composite index on ["monitor_id", "created_at"]:
// database/migrations/2026_12_01_210553_create_checks_table.rs
use laravel::db::AnyTransaction;
pub async fn migrate(tx: &mut AnyTransaction<'_>) -> laravel::Result<()> {
tx.schema()
.create("checks", |table| {
table.id();
table.foreign_id("monitor_id").constrained().cascade_on_delete();
table.integer("status_code");
table.integer("latency_ms");
table.boolean("ok");
table.text("error").nullable();
table.timestamps();
table.index(["monitor_id", "created_at"]);
})
.await
}
For framework-managed tables (cache, queues, sessions, feature flags, and workflows) you don’t even write the columns by hand.
A single macro generates the whole migration:
// database/migrations/2026_12_01_210557_create_workflow_tables.rs
laravel::workflow::tables!();
Typed models, enums, and colocated factories
Now let’s define Monitor, Check, a typed MonitorStatus enum, and MonitorFactory together in src/models/monitor.rs.
One pattern I love from Laravel Rust’s conventions is to keep a model’s factory and authorization policy in the same file as the model, so they never drift out of sync.
// src/models/monitor.rs
use laravel::model::{BelongsTo, Faker, HasMany, IntoCreate, create, factory, model};
use laravel::prelude::*;
use laravel::time::Timestamp;
use serde::{Deserialize, Serialize};
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize, Enum)]
#[serde(rename_all = "snake_case")]
pub enum MonitorStatus {
Up,
Down,
Paused,
}
#[model]
pub struct Monitor {
pub id: i64,
pub name: String,
pub url: String,
#[default]
pub interval_seconds: i64,
#[default]
pub status: MonitorStatus,
pub last_latency_ms: Option<i64>,
pub last_checked_at: Option<Timestamp>,
pub created_at: Timestamp,
pub updated_at: Timestamp,
#[has_many]
pub checks: HasMany<Check>,
}
#[model]
pub struct Check {
pub id: i64,
pub monitor_id: i64,
pub status_code: i64,
pub latency_ms: i64,
pub ok: bool,
pub error: Option<String>,
pub created_at: Timestamp,
pub updated_at: Timestamp,
#[belongs_to]
pub monitor: BelongsTo<Monitor>,
}
#[factory(Monitor)]
pub struct MonitorFactory;
impl MonitorFactory {
fn definition(fake: &mut Faker) -> impl IntoCreate<Monitor> {
let slug = fake.unique().word();
create!(Monitor {
name: format!("{slug} service"),
url: format!("https://{slug}.flaviocopes.com/health"),
interval_seconds: 60,
status: MonitorStatus::Up,
})
}
pub fn down(self) -> Self {
self.state(|monitor, _| monitor.status(MonitorStatus::Down))
}
pub fn paused(self) -> Self {
self.state(|monitor, _| monitor.status(MonitorStatus::Paused))
}
}
Re-export them from src/models/mod.rs:
// src/models/mod.rs
mod monitor;
mod user;
pub use monitor::{Check, Monitor, MonitorFactory, MonitorStatus};
pub use user::{User, UserFactory};
Look at what #[model] gives you for free:
- Typed column expressions. Instead of string column names, you write
Monitor::status.eq(MonitorStatus::Down) & Monitor::interval_seconds.lte(60). Combine conditions with&,|, and!instead of nesting closures. If you misspell a column or compare an integer column against a string, the code does not compile. - No accidental N+1 queries. Laravel Rust never silently lazy-loads relationships behind your back. You load what you need explicitly with
.with(Monitor::checks). - Rich column types out of the box. Beyond integers and strings,
#[model]supportsDecimalfor money,Uuid(v7) andUlid,IpAddr, typeddb::Jsonstructs,Encrypted<T>,Vectorfor embeddings,PasswordHash, andRememberToken. - Safe raw SQL when you need it. Drop down to
db::query!("SELECT * FROM monitors WHERE status = {status} AND id IN {...ids}")whenever you need a complex report. It looks like string interpolation, but the macro compiles every{...}capture into real bound SQL parameters so SQL injection is impossible.
Typed validation, fill structs, and handlers
This is my favorite API in the entire framework.
In Laravel PHP, you write string validation rules and you have to remember to maintain $fillable or $guarded arrays on your Eloquent models so users can’t sneak is_admin=1 into a form POST.
In Laravel Rust, you define a Rust struct with #[laravel::input(fills = Monitor)] and you put validation attributes on each field:
// src/http/handlers/monitors.rs
use laravel::http::StatusCode;
use laravel::inertia::{self, Page, props};
use laravel::model::{create, update};
use laravel::prelude::*;
use laravel::task;
use laravel::validation::Sometimes;
use serde_json::json;
use crate::jobs::RunCheck;
use crate::models::{Check, Monitor, MonitorStatus};
#[laravel::input(fills = Monitor)]
#[validate(anyone)]
pub struct StoreMonitor {
#[validate(required, max_length(120))]
pub name: String,
#[validate(required, url, unique(Monitor::url))]
pub url: String,
#[validate(min_value(10), max_value(3600))]
pub interval_seconds: Sometimes<i64>,
}
#[laravel::input(fills = Monitor)]
#[validate(anyone)]
pub struct UpdateMonitor {
#[validate(required, max_length(120))]
pub name: Sometimes<String>,
#[validate(min_value(10), max_value(3600))]
pub interval_seconds: Sometimes<i64>,
pub status: Sometimes<MonitorStatus>,
}
Four guardrails are built straight into those types:
- Mandatory authorization. Every input struct must declare
#[validate(anyone)],#[validate(authenticated)], or anauthorizefunction. Leave it off and the compiler refuses to build. - Zero mass-assignment bugs. Because
create!(Monitor { ..input })only writes fields declared onStoreMonitor, any extra JSON keys sent by a client are ignored. - Clean partial
PATCHupdates withSometimes<T>. A regularOption<T>cannot tell whether a client omitted a field or explicitly sentnull.Sometimes<T>distinguishesMissing(leave the column untouched) fromPresent(val). UseSometimes<Option<T>>when a client should be able to explicitly clear a nullable column withnull. - Redacted secrets by type. On
User, the built-inPasswordHashandRememberTokentypes do not implementSerialize, so yourUsermodel will not even compile unless you mark them#[serde(skip)]. You literally cannot leak password hashes into JSON or Inertia props by mistake.
Now look at the handlers in src/http/handlers/monitors.rs.
Notice how task::try_join! runs all 3 database queries concurrently on Tokio, so the page latency is only as slow as the slowest query, not the sum of all 3:
pub async fn index() -> laravel::Result<Page> {
let (monitors, total_checks, down_count) = task::try_join!(
Monitor::query().order_by(Monitor::id.asc()).get(),
Check::query().count(),
Monitor::query()
.filter(Monitor::status.eq(MonitorStatus::Down))
.count(),
)?;
Ok(inertia::render(
"Monitors/Index",
props! { monitors, total_checks, down_count },
))
}
pub async fn api_store(
Valid(input): Valid<StoreMonitor>,
) -> laravel::Result<(StatusCode, Json<Monitor>)> {
let monitor = create!(Monitor { ..input }).await?;
RunCheck {
monitor: monitor.clone(),
}
.dispatch()
.await?;
Ok((StatusCode::CREATED, Json(monitor)))
}
pub async fn api_update(
mut monitor: Monitor,
Valid(input): Valid<UpdateMonitor>,
) -> laravel::Result<Json<Monitor>> {
update!(monitor { ..input }).await?;
Ok(Json(monitor))
}
pub async fn api_destroy(monitor: Monitor) -> laravel::Result<StatusCode> {
monitor.delete().await?;
Ok(StatusCode::NO_CONTENT)
}
If a client sends invalid data to POST /api/monitors, api_store will never run. Laravel will return a 422 Unprocessable Entity JSON payload with the field-by-field errors (and for web form posts, it will redirect back with the flashed errors and old input).
If a client sends {"status":"paused"} to PATCH /api/monitors/4, update! will only touch status and updated_at.
Here is the real response from our compiled Pingwatch server:

Notice the x-request-id, x-content-type-options: nosniff, x-frame-options: SAMEORIGIN and the structured Laravel validation message format, all working out of the box.
Async concurrency, queued jobs, and scheduled tasks
In addition to task::try_join!, the laravel::task module provides async building blocks that automatically carry your application context and tracing spans:
task::select!races competing futures (for example, primary and backup exchange-rate APIs) and cancels the loser.task::map(items, 5, async |item| ...)processes a list with a concurrency cap and preserves input order.task::timeout(5.seconds(), future)enforces a deadline and cancels hung upstream calls.task::background(async move { ... })fires lightweight post-response work and waits for it on graceful shutdown.task::spawn_blocking(...)moves CPU-heavy work off async worker threads.- Repeating in-process ticks let you flush in-memory metrics or view counters on an interval, with one final flush on shutdown.
For work that needs to survive restarts and retry on failure, we have queued jobs.
We define a struct that derives Queueable and we put handle inside a #[job] block.
Laravel automatically discovers jobs in database, redis, sqs and Laravel Cloud managed queues.
Here is Pingwatch’s RunCheck job in src/jobs/run_check.rs:
// src/jobs/run_check.rs
use std::time::Instant;
use laravel::http::client;
use laravel::model::{create, update};
use laravel::prelude::*;
use laravel::queue::{Queueable, job};
use laravel::task;
use crate::events::MonitorStatusChanged;
use crate::models::{Check, Monitor, MonitorStatus};
use crate::workflows::EscalateOutage;
#[derive(Queueable)]
pub struct RunCheck {
pub monitor: Monitor,
}
#[job]
impl RunCheck {
async fn handle(mut self) -> laravel::Result<()> {
let started = Instant::now();
let outcome = task::timeout(5.seconds(), client::get(&self.monitor.url)).await;
let latency_ms = started.elapsed().as_millis() as i64;
let (status_code, ok, error) = match outcome {
Ok(Ok(response)) => {
let code = response.status().as_u16() as i64;
(code, (200..400).contains(&code), None)
}
Ok(Err(err)) => (0, false, Some(err.to_string())),
Err(_) => (504, false, Some("request timed out after 5s".into())),
};
create!(Check {
monitor_id: self.monitor.id,
status_code,
latency_ms,
ok,
error,
})
.await?;
let previous = self.monitor.status;
let next = if ok { MonitorStatus::Up } else { MonitorStatus::Down };
update!(self.monitor {
status: next,
last_latency_ms: Some(latency_ms),
last_checked_at: Some(laravel::now()),
})
.await?;
if next != previous {
MonitorStatusChanged {
monitor_id: self.monitor.id,
name: self.monitor.name.clone(),
status: next,
latency_ms,
}
.dispatch()
.await?;
if next == MonitorStatus::Down {
EscalateOutage {
monitor_id: self.monitor.id,
}
.start()
.await?;
}
}
Ok(())
}
}
Notice how RunCheck holds the Monitor struct directly.
Just like Laravel PHP SerializesModels, when you dispatch RunCheck, Laravel serializes only monitor.id into the queue payload, and reloads a fresh Monitor row right before handle runs.
Custom commands and the task scheduler
Console commands are annotated with #[command("name")], so let’s add a monitors:summary command in src/console/monitors_summary.rs:
// src/console/monitors_summary.rs
use laravel::console::{Console, command};
use crate::models::{Monitor, MonitorStatus};
/// Print a summary of all registered monitors
#[command("monitors:summary")]
async fn monitors_summary(console: &mut Console) -> laravel::Result<()> {
let monitors = Monitor::query().order_by(Monitor::id.asc()).get().await?;
for monitor in &monitors {
let state = match monitor.status {
MonitorStatus::Up => "UP",
MonitorStatus::Down => "DOWN",
MonitorStatus::Paused => "PAUSED",
};
let latency = monitor
.last_latency_ms
.map(|ms| format!("{ms}ms"))
.unwrap_or_else(|| "-".into());
console.line(format!(
"[#{id}] {state:<6} {latency:>6} {name} ({url})",
id = monitor.id,
name = monitor.name,
url = monitor.url,
));
}
Ok(())
}
Then wire up the scheduler in src/console/mod.rs so Pingwatch queues a check for every active monitor every minute.
On a traditional server you only ever install one cron line calling ./pingwatch schedule:run, and on Laravel Cloud the built-in scheduler wakes your app on time even if it scaled to zero:
// src/console/mod.rs
mod inspire;
mod monitors_summary;
use laravel::schedule::{self, Schedule};
use crate::jobs::RunCheck;
use crate::models::{Monitor, MonitorStatus};
#[schedule::tasks]
fn schedule(schedule: &mut Schedule) {
schedule.call(dispatch_due_checks).every_minute();
}
async fn dispatch_due_checks() -> laravel::Result<()> {
let monitors = Monitor::query()
.filter(Monitor::status.ne(MonitorStatus::Paused))
.get()
.await?;
for monitor in monitors {
RunCheck { monitor }.dispatch().await?;
}
Ok(())
}
I seeded 4 real endpoints into Pingwatch and ran ./target/release/pingwatch queue:work --stop-when-empty.
Here’s what happened live:
Processing jobs from `database:default`. Press Ctrl+C to stop.
jobs::run_check::RunCheck 687.3ms
jobs::run_check::RunCheck 1.71s
jobs::run_check::RunCheck 714.1ms
jobs::run_check::RunCheck 582.2ms
events::MonitorStatusChanged 0.6ms
workflow monitors.escalate_outage 3.2ms
https://updates.flaviocopes.com/health returned a 404, so RunCheck recorded the failed check, flipped the monitor to down, broadcast MonitorStatusChanged in 0.6 ms and kicked off the durable EscalateOutage workflow in 3.2 ms.
Durable, fault-tolerant workflows
Durable workflows are brand new in Laravel, and they solve one of the messiest problems in backend engineering.
Think about a process that spans minutes, days, or weeks. You might wait 5 minutes to see if an outage resolves before waking an on-call engineer, wait 3 days after signup to send onboarding tips, or pause until a manager clicks an approval link.
Normally you’d build a tangled web of delayed jobs, status columns, and cron sweepers. Or you’d deploy a separate orchestration cluster like Temporal.
In Laravel Rust, you write the entire multi-step flow as one plain async function, annotated with #[workflow].
Here is Pingwatch’s outage escalation workflow in src/workflows/escalate_outage.rs:
// src/workflows/escalate_outage.rs
use laravel::queue::Queueable;
use laravel::time::ToSpan;
use laravel::workflow::{Run, workflow};
use crate::models::{Monitor, MonitorStatus};
#[derive(Queueable)]
pub struct EscalateOutage {
pub monitor_id: i64,
}
#[workflow(name = "monitors.escalate_outage")]
impl EscalateOutage {
async fn handle(self, run: &Run) -> laravel::Result<String> {
run.step("send initial alert", async {
tracing::warn!(monitor_id = self.monitor_id, "monitor down: initial alert sent");
Ok::<_, laravel::Error>(())
})
.await?;
run.sleep(5.minutes()).await?;
let still_down = run
.step("check monitor status", async {
let monitor = Monitor::find(self.monitor_id).await?;
Ok::<_, laravel::Error>(matches!(
monitor.map(|m| m.status),
Some(MonitorStatus::Down)
))
})
.await?;
if still_down {
run.step("send escalation alert", async {
tracing::error!(monitor_id = self.monitor_id, "monitor still down after 5 minutes");
Ok::<_, laravel::Error>(())
})
.await?;
return Ok("escalated".into());
}
Ok("recovered".into())
}
}
Workflows run on your existing queue workers, with zero extra infrastructure.
Click through the diagram below to see how a sleeping workflow survives deploys and restarts, while using zero worker memory:
Always give production workflows an explicit name = "..." attribute, so moving or renaming the Rust struct later will never leave runs already sleeping in the database orphaned.
Workflows also support run.wait_for(token) to wait for external webhooks, and signed resume URLs (/_workflow/resume) to wait for human approval buttons.
Plus CLI tools (workflow:list, workflow:show, workflow:retry, workflow:cancel) to inspect active runs.
Here is laravel route:list, our custom laravel monitors:summary, and laravel workflow:list showing that real sleeping monitors.escalate_outage run right in SQLite:

Realtime WebSockets, Inertia v3, Mail, and OpenTelemetry
Most Rust web tutorials I find stop at the JSON API.
Laravel Rust goes all the way through the full-stack layer.
Broadcasting and Reverb in Rust
Any event can broadcast over WebSockets by adding #[event(broadcast(..))]:
// src/events/mod.rs
use laravel::event::Event;
use crate::models::MonitorStatus;
#[derive(Event)]
#[event(broadcast(public = "monitors"))]
pub struct MonitorStatusChanged {
pub monitor_id: i64,
pub name: String,
pub status: MonitorStatus,
pub latency_ms: i64,
}
Only pub fields serialize on the wire. Anything marked pub(crate) or private is not serialized, so internal notes will never leak to the browser.
For private and presence channels (private = "monitors.{monitor_id}"), you authorize subscriptions in src/routes/channels.rs using the same extractors and route model binding we use for HTTP handlers.
Even better, Laravel Rust ships a Reverb WebSocket server written in Rust behind the reverb Cargo feature.
Run laravel reverb:start locally alongside laravel dev to test real-time updates with Laravel Echo’s useEcho React hook over the Pusher protocol, and swap your env vars to managed Reverb on Laravel Cloud when you deploy.
Inertia v3, React 19, and Vite Plus
Every new Laravel Rust app is pre-wired with Inertia v3, React 19, TypeScript, Tailwind CSS v4 and Vite Plus (vp dev, vp build, vp check).
You return inertia::render("Monitors/Index", props! { monitors, total_checks, down_count }) from Rust, and your React component gets those props directly, without having to maintain a REST client or a client-side router.
It supports all the modern features of Inertia: deferred props (load expensive secondary widgets after the initial paint), live props (automatically refresh a page when a broadcast event fires), prefetching, polling, history encryption, and Node.js server-side rendering (npm run build:ssr).
If you prefer plain server-rendered HTML templates, Laravel Rust also includes a built-in view engine under resources/views/.
Here is our Pingwatch Monitors/Index.tsx dashboard, rendered live by the compiled 43 MB Rust binary:

What about Livewire and Flux UI?
If you come from modern Laravel PHP, two names probably popped into your head right away: Livewire and Flux UI.
Livewire does not run on Laravel Rust. Livewire is tied to PHP and Blade templates, so there is no Rust port of it. In Laravel Rust, Inertia v3 (with React, Vue, or Svelte) takes over as the default way to build interactive UIs, and features like live props (refreshing page data automatically from Reverb broadcasts) and polling cover much of the reactive server-driven feel Livewire developers like. If you prefer staying in server-rendered HTML without a JavaScript framework, you can pair the built-in resources/views/ templates (powered by MiniJinja) with htmx and Alpine.js.
Flux UI does carry over through Flux for React. While the original Flux UI is built for Livewire and Blade, the Flux team also ships Flux for React (@fluxui-dev/react, currently in beta on top of Base UI and Tailwind CSS v4). Laravel even published an official laravel/laravel-rust-flux-react starter kit alongside this release, wiring Laravel Rust, Inertia v3, React 19, and Flux for React together with login, registration, password reset, and Flux’s sidebar dashboard layout out of the box.
Mail, OpenTelemetry, Social Login, and Feature Flags
A few other built-ins save days on real projects:
- Typed Mailables: Derive
Mailableon a struct, pass its fields to a template, and Laravel generates both HTML and plain-text versions automatically. First-party Resend and Amazon SES transports plus mailer failover ship out of the box (note that raw SMTP is not bundled by default, though you can write a custom transport). - Zero-config OpenTelemetry tracing: Enable the
opentelemetryfeature and pointOTEL_EXPORTER_OTLP_ENDPOINTat Sentry, Grafana, or Jaeger. Incoming requests, SQL queries (with literals automatically redacted to?), cache lookups, outgoing HTTP calls, queued jobs, and workflow steps emit timed spans automatically. - Social login and feature flags: OAuth login for Google, GitHub, and Microsoft, persistent feature flags (
laravel::feature::table!()), and server-rendered<head>tags for SEO all come built in.
Testing with isolated apps, fakes, and time travel
Testing is where Laravel has always spoiled us, and Laravel Rust is no different.
Every #[laravel::test] boots an isolated in-memory application with its own database (via refresh_database() in src/testing.rs), its own cache, and its own clock we can control. Cargo runs your tests in parallel without port conflicts or shared state leaks.
Here’s the full integration test suite of Pingwatch in tests/monitors.rs, exercising HTTP creation, queue faking, 422 validation errors, partial PATCH, 404 route model binding, and time-traveling 5 minutes into the future to test both branches of our durable EscalateOutage workflow:
// tests/monitors.rs
use laravel::model::update;
use laravel::queue;
use laravel::testing::prelude::*;
use app::jobs::RunCheck;
use app::models::{Monitor, MonitorStatus};
use app::workflows::EscalateOutage;
#[laravel::test]
async fn creating_a_monitor_persists_and_queues_a_check(app: Application) -> laravel::Result<()> {
let queues = queue::fake();
app.post("/api/monitors")
.json(json!({
"name": "Flavio Copes Blog",
"url": "https://flaviocopes.com",
"interval_seconds": 30
}))
.await
.assert_created()
.assert_json_path("name", "Flavio Copes Blog")
.assert_json_path("status", "up");
queues.assert_pushed::<RunCheck>();
Ok(())
}
#[laravel::test]
async fn invalid_monitor_payload_returns_422(app: Application) {
app.post("/api/monitors")
.json(json!({
"name": "",
"url": "not-a-url",
"interval_seconds": 2
}))
.await
.assert_unprocessable()
.assert_invalid(&["name", "url", "interval_seconds"]);
}
#[laravel::test]
async fn partial_patch_only_updates_sent_fields(app: Application) -> laravel::Result<()> {
let monitor = Monitor::factory().create().await?;
app.patch(format!("/api/monitors/{}", monitor.id))
.json(json!({ "status": "paused" }))
.await
.assert_ok()
.assert_json_path("name", monitor.name.as_str())
.assert_json_path("status", "paused");
Ok(())
}
#[laravel::test]
async fn outage_workflow_escalates_if_monitor_stays_down(app: Application) -> laravel::Result<()> {
let monitor = Monitor::factory().down().create().await?;
let run = app
.workflow(EscalateOutage { monitor_id: monitor.id })
.await;
run.assert_step_ran("send initial alert");
run.assert_sleeping();
app.travel(5.minutes());
run.advance().await;
run.assert_step_ran("send escalation alert");
run.assert_completed_with("escalated".to_string());
Ok(())
}
When I ran cargo test --test monitors, all 6 tests finished in 0.01 seconds:

For a more in-depth look at how to structure fast integration tests and CI pipelines across the stack, check out my Testing, Debugging & CI/CD Handbook.
Built for coding agents and everything else launched today
Laravel Rust did not launch alone. Today’s release reshaped the entire Laravel ecosystem around 2 big ideas: agent-native development and Laravel Cloud running any framework.
Click through the map below to see how all 3 layers connect:
1. Seven built-in Agent Skills inside every Laravel Rust app
When you run laravel new pingwatch --rust, the skeleton automatically creates AGENTS.md, CLAUDE.md (which imports @AGENTS.md), and 7 Agent Skills under .agents/skills/:
writing-laravel-rust-appsdatabase-and-modelsvalidation-and-inputauth-and-authorizationqueues-and-workflowstesting-laravel-rust-appsinertia-frontend
The smartest touch is .agents/skills/writing-laravel-rust-apps/scripts/docs-path.sh.
Every laravel-rust crate ships all 69 Markdown documentation files inside the Cargo package.
That little script asks cargo metadata and prints the local docs folder of the installed version.
Your coding agent reads the real APIs of 0.1.3 from disk, instead of guessing outdated Laravel PHP methods from its training data.
2. Laravel Cloud for every framework, plus Cloud MCP, Issues, Domains, and Model Gateway
Laravel Cloud today expanded well beyond PHP.
You can now push apps written in Laravel Rust, Laravel PHP, Symfony, Ruby on Rails, Django, FastAPI, Flask, Express, NestJS, Hono, Next.js, Nuxt, TanStack Start, and Go on one organization plan and one bill, with unlimited apps and no per-seat fees.
Even better, a Laravel PHP app and a Laravel Rust app in the same organization and region can attach to the same managed PostgreSQL or MySQL database.
This means you can keep your existing PHP monolith running, and peel off high-traffic endpoints or background processors into Laravel Rust, one route at a time.
Along with multi-framework hosting, 4 major Cloud additions landed:
- Laravel Cloud MCP: Connect your coding agent to
https://cloud.laravel.com/mcp(claude mcp add --transport http laravel-cloud https://cloud.laravel.com/mcpin Claude Code, with guides for Cursor, Codex, and Amp). Your agent can create apps, attach databases, inspect failed build logs, read errors, and trigger deploys without you switching tabs. You control read-write, read-only, or disabled access per organization. (If you want to learn how to build MCP servers yourself, check out my MCP Server Handbook.) - Laravel Cloud Issues (beta): Built-in error tracking with zero SDK setup. It groups repeated exceptions, alerts via email or Slack, shows the stack trace at the deployed commit, and lets you copy an issue as Markdown for your agent or read it straight through Cloud MCP. (Launching for Laravel PHP 9–13 first.)
- Domains and DNS: Register a domain or bring an existing one inside Laravel Cloud, attach it to an environment, and Cloud configures DNS records and TLS certificates automatically.
- Laravel Cloud Model Gateway (early access): One API key for Anthropic, OpenAI, and other model providers, billed from Cloud AI credits, with hard per-key spending caps so a stuck agent loop cannot run up a surprise bill. You can even lock a key so it only works inside Laravel Cloud.
3. Laravel Converse and Agent Kit for Laravel PHP
Taylor was very clear that Laravel PHP is not going into maintenance mode.
Along with Laravel Rust, Laravel released 2 open source agent tools for PHP: Laravel Converse and Agent Kit.
| Tool | Ecosystem | What it does | When to reach for it |
|---|---|---|---|
Laravel Rust + .agents/skills | Rust | Full-stack framework with built-in agent skills and crate-bundled docs | Net-new high-performance web apps and APIs |
| Laravel AI SDK | PHP | Unified API across OpenAI, Anthropic, Gemini, and Model Gateway | Adding LLM calls and tools to any Laravel PHP app |
| Laravel Converse (new) | PHP | One bot API for Slack, Telegram, GitHub, and React/Vue useChat, with thread persistence and tool approvals | Putting an AI agent where your team already chats |
| Laravel Agent Kit (new) | PHP | Starter app (composer create-project laravel/agent-kit) wiring AI SDK, Converse, MCP, Boost, and Pest evals | Spinning up a standalone team agent in minutes |
| Laravel Cloud MCP (new) | Any framework | Hosted MCP server letting Claude Code, Cursor, or Codex deploy and debug Cloud apps | Managing infrastructure straight from your coding agent |
| Cloud Model Gateway (early access) | Any framework | Single LLM key with hard per-key budget caps and request cost tracking | Preventing runaway AI bills across apps and agents |
With Agent Kit, you run php artisan converse:chat to test your agent in your terminal (watching every tool call and token count), write Pest evals where a model grades your agent’s replies, and deploy to Laravel Cloud with scale-to-zero so a quiet team bot costs almost nothing when nobody is talking to it.
Real-world tutorial: building ShipVote with a coding agent
Theory is useful, so let’s see what happens when you hand a fresh Laravel Rust app to a coding agent from start to finish and inspect what it builds.
For a realistic example, let’s build ShipVote, a public feature-request and roadmap voting board. Visitors can browse ideas sorted by votes and filter by status. Signed-in users can submit ideas, upvote or remove their vote atomically, and delete their own posts. Admins can move ideas across open, planned, in_progress, and shipped, and marking an idea as shipped queues a background notification job.
Step 1: Scaffolding and the prompt
First, scaffold a clean project with the CLI:
laravel new shipvote --rust
That finished in 29.7s and pulled laravel-rust 0.1.4 (a patch release had already shipped on crates.io since our earlier Pingwatch test).
Next, we hand the workspace to a coding agent with a clear, concrete prompt:
Read AGENTS.md and the relevant skills under .agents/skills/ first.
Build ShipVote, a feature-request and public roadmap voting board on SQLite:
- Session authentication (register, login, logout) plus an `is_admin` flag on User.
- Feature ideas with title, description, votes counter, and status
(open, planned, in_progress, shipped).
- Authenticated users can submit ideas and toggle one vote per idea atomically
inside a database transaction.
- Only admins can change an idea's status (enforced by a policy). Flipping an
idea to `shipped` dispatches a queued `NotifyIdeaShipped` job.
- Only the author or an admin can delete an idea.
- Build the UI with Inertia v3, React 19, and Tailwind CSS, sharing the
logged-in user on every page.
- Seed realistic demo data and write integration tests covering auth,
validation, policies, atomic voting, and queued jobs.
- Verify with cargo test, cargo clippy, npm run types:check, and npm run build.
Step 2: How the agent used the built-in skills
Before writing any Rust code, the agent read AGENTS.md and four of the bundled skills: writing-laravel-rust-apps, auth-and-authorization, inertia-frontend, and testing-laravel-rust-apps.
It then ran the helper script inside the repo:
.agents/skills/writing-laravel-rust-apps/scripts/docs-path.sh
That returned the local docs folder for laravel-rust-0.1.4 inside Cargo’s registry cache. Because the agent read those files before coding, three conventions landed cleanly right away without extra prompting:
- Sub-resource handlers instead of custom verbs. Instead of cramming
toggle_voteandchange_statusinto one bigideas.rsfile, the agent split them intoidea_votes::storeandidea_statuses::update. - Colocated model, policy, and factory. Following the skill’s top-down layout,
src/models/idea.rskeepsIdeaStatus,Idea,IdeaVote,IdeaPolicy, andIdeaFactorytogether in 89 lines. - Keeping test fakes alive. The testing skill warns never to write
let _ = queue::fake();, because Rust drops_immediately and turns the fake off before the request runs. The agent boundlet queues = queue::fake();so assertions actually ran against the fake queue.
Step 3: Reviewing what the agent wrote
When you open the diff an agent produces in Laravel Rust, every piece sits where a Laravel developer expects to find it.
Start with src/routes/web.rs. Guest-only routes sit inside RedirectIfAuthenticated, authenticated mutations sit inside Authenticate, and each action points at a small handler:
// src/routes/web.rs
use laravel::auth::{Authenticate, RedirectIfAuthenticated};
use laravel::prelude::*;
use crate::http::handlers::{auth, idea_statuses, idea_votes, ideas};
pub fn routes(route: &mut Router) {
route.get("/", ideas::index);
route.middleware(RedirectIfAuthenticated).group(|route| {
route.get("/login", auth::show_login);
route.post("/login", auth::login);
route.get("/register", auth::show_register);
route.post("/register", auth::register);
});
route.middleware(Authenticate).group(|route| {
route.post("/logout", auth::logout);
route.post("/ideas", ideas::store);
route.delete("/ideas/{idea}", ideas::destroy);
route.post("/ideas/{idea}/votes", idea_votes::store);
route.patch("/ideas/{idea}/status", idea_statuses::update);
});
route.fallback(async || laravel::abort(404));
}
Next, look at the authorization policy in src/models/idea.rs. #[policy] lets you return either an Access value with a custom denial message or a plain bool:
// src/models/idea.rs (excerpt)
pub struct IdeaPolicy;
#[policy]
impl IdeaPolicy {
pub fn update_status(user: &User, _idea: &Idea) -> Access {
if user.is_admin {
Access::allow()
} else {
Access::deny("Only administrators can change roadmap status.")
}
}
pub fn delete(user: &User, idea: &Idea) -> bool {
user.is_admin || user.id == idea.user_id
}
}
For voting, the prompt asked for one vote per user per idea updated atomically. The agent created a unique (idea_id, user_id) index in the idea_votes migration and wrapped the toggle in db::transaction inside src/http/handlers/idea_votes.rs:
// src/http/handlers/idea_votes.rs
use laravel::auth::Authenticated;
use laravel::db;
use laravel::model::{create, update};
use laravel::prelude::*;
use crate::models::{Idea, IdeaVote, User};
pub async fn store(
Authenticated(user): Authenticated<User>,
mut idea: Idea,
) -> laravel::Result<Redirect> {
db::transaction(async |_tx| {
let existing = IdeaVote::query()
.filter(IdeaVote::idea_id.eq(idea.id) & IdeaVote::user_id.eq(user.id))
.first()
.await?;
if let Some(vote) = existing {
vote.delete().await?;
update!(idea { votes -= 1 }).await?;
} else {
create!(IdeaVote {
idea_id: idea.id,
user_id: user.id,
})
.await?;
update!(idea { votes += 1 }).await?;
}
Ok(())
})
.await?;
Ok(Redirect::back())
}
Notice how update!(idea { votes += 1 }) generates an atomic SQL increment right inside the macro, and Authenticated(user) guarantees a signed-in user before the handler body runs.
Now look at src/http/handlers/idea_statuses.rs. It validates the incoming IdeaStatus enum, checks IdeaPolicy::update_status (returning 403 Forbidden for regular users), updates the row, and dispatches NotifyIdeaShipped only when an idea transitions into Shipped:
// src/http/handlers/idea_statuses.rs
use laravel::auth::Authenticated;
use laravel::model::update;
use laravel::prelude::*;
use crate::jobs::NotifyIdeaShipped;
use crate::models::{Idea, IdeaPolicy, IdeaStatus, User};
#[laravel::input]
#[validate(authenticated)]
pub struct UpdateIdeaStatus {
pub status: IdeaStatus,
}
pub async fn update(
Authenticated(user): Authenticated<User>,
mut idea: Idea,
Valid(input): Valid<UpdateIdeaStatus>,
) -> laravel::Result<Redirect> {
user.authorize(IdeaPolicy::update_status, &idea).await?;
let was_shipped = idea.status == IdeaStatus::Shipped;
update!(idea {
status: input.status,
})
.await?;
if input.status == IdeaStatus::Shipped && !was_shipped {
NotifyIdeaShipped { idea }.dispatch().await?;
}
Ok(Redirect::back())
}
On the frontend, the agent built 3 React + TypeScript pages (Ideas/Index.tsx, Auth/Login.tsx, and Auth/Register.tsx) using Inertia’s useForm and router helpers, with HandleInertiaRequests sharing auth.user across every page. Both npm run types:check and npm run build passed on the first try in 454 ms.
Step 4: The real compiler errors the agent hit
The Rust side did not pass on the first compile, and seeing why it failed is the most revealing part of using coding agents with Laravel Rust.
Even with the skills loaded, the agent slipped into Laravel PHP muscle memory in 3 places. When it ran cargo test, rustc caught every mismatch in a few seconds:
error[E0599]: no method named `auth` found for reference `&laravel::http::Request`
--> src/http/middleware/handle_inertia_requests.rs:10:28
|
10 | let user = request.auth::<User>()?.user().await?;
error[E0061]: this method takes 0 arguments but 1 argument was supplied
--> src/models/idea.rs:75:25
|
75 | title: fake.sentence(5),
76 | description: fake.paragraph(2),
error[E0599]: no method named `acting_as` found for struct `laravel::Application`
--> tests/ideas.rs:34:9
|
34 | app.acting_as(&user)
Every one of those came from PHP habits:
- In
HandleInertiaRequests::share, the agent guessedrequest.auth::<User>()?.user().await?. Readingdocs/inertia.mdfromdocs-path.shshowed the real API islet user: Option<User> = request.user().await?;. - In
IdeaFactory, it passed counts tofake.sentence(5)andfake.paragraph(2)like PHP Faker, while Laravel Rust’sFakertakes zero arguments (fake.sentence()andfake.paragraph()). - In
tests/auth.rsandtests/ideas.rs, it wroteapp.acting_as(&user).post(...)andapp.from("/login").post(...)like Laravel PHP’s$this->actingAs($user)->post(...). Readingdocs/testing.mdshowed Laravel Rust chains.acting_as(&user)and.from("/login")after the verb:app.post("/ideas").acting_as(&user).
In a dynamic language, a wrong method call inside a seldom-hit branch can slip past a quick check until runtime. Here, the compiler pointed straight at the exact file and line, the agent checked the local 0.1.4 Markdown docs, applied both fixes, and re-ran cargo test.
The incremental recompile took 0.88s, and all 10 integration tests passed. cargo clippy --all-targets also came back with zero warnings.
Step 5: Inspecting the running app and test suite
After running laravel migrate:fresh, laravel db:seed, and cargo build --release, we started the compiled ./target/release/shipvote binary and signed in as the seeded admin account (flavio@flaviocopes.com).
Here is the live ShipVote board rendered by the single compiled binary:

And here is laravel route:list alongside cargo test --test auth --test ideas, showing all 9 ShipVote integration tests (registration, login/logout, validation errors, guest redirect, atomic voting toggle, admin-only status updates with queue::fake(), and author/admin deletion) passing in 0.04s combined:

Here are the real measurements from the finished ShipVote build on my Mac:
| Metric | Measured result |
|---|---|
| Application code written by the agent | 18 files, 1,209 lines (780 Rust + 429 React/TS) |
First-compile issues caught by rustc | 3 API mismatches (all from PHP habits, fixed via bundled docs) |
Incremental test compile (cargo test) | 0.88s |
| Integration test execution (9 ShipVote tests) | 0.04s (0.02s auth + 0.02s ideas) |
| Static checks | 0 Clippy warnings, 0 TypeScript errors |
Frontend production bundle (npm run build) | 454 ms |
Release binary (cargo build --release) | 33.56s, 41 MB single binary |
| Live binary RSS after serving requests | 29.8 MB |
Live GET / Inertia response (SQLite + auth) | 1.2 ms (warm), 5.9 ms (first request) |
Reviewing what the agent built makes Laravel’s pitch click. Because the framework fixes the folder structure, ships version-matched docs inside the crate, and pairs them with Rust’s compiler, you spend your review time checking business rules (like whether voting is transactional and whether IdeaPolicy blocks regular users) instead of chasing boilerplate or hallucinated methods.
Building for production and deploying
When you’re ready to ship Pingwatch, you have 2 clean options: deploy the compiled binary on your own server, or push straight to Laravel Cloud.
Building the release binary
Stop laravel dev, build the frontend bundle, and compile Rust in release mode:
npm run build
cargo build --release
On my Mac, npm run build took 293 ms and cargo build --release took 54.98s, writing a single 43 MB binary to target/release/pingwatch.
You ship that binary along with 3 directories (public/ for the built assets, resources/views/ for the templates and the Inertia root view, and storage/ if you use the local disk), you set APP_ENV=production, APP_DEBUG=false, a fresh APP_KEY, and SERVER_HOST=0.0.0.0, and you run:
./pingwatch migrate --force
./pingwatch
If you use queued jobs, run ./pingwatch queue:work under systemd next to the web server.
Because Laravel handles SIGTERM gracefully (draining in-flight requests for up to 20 seconds by default, closing SSE streams, running final shutdown ticks), zero-downtime restarts are easy on any VPS (my Linux Server Handbook covers systemd, reverse proxy and TLS setup, if you self-host).
Deploying on Laravel Cloud
If you don’t want to deal with servers, you can push the repository to GitHub and connect it to Laravel Cloud.
Cloud will detect Laravel Rust automatically, and you’ll have managed PostgreSQL or MySQL, Valkey caches, scale-to-zero Flex compute, managed SQS-backed queues (scaling workers with your backlog), managed Reverb WebSockets, and a built-in scheduler.
Set your Cloud build and deploy commands to:
# Build commands
cargo build --release
npm ci && npm run build
# Deploy commands
pingwatch migrate --force
One Cloud detail from the launch docs: while Laravel Cloud also runs Axum, Actix Web, Rocket, and Warp apps, managed queues are currently wired specifically for Laravel Rust, Laravel PHP, Symfony and Rails.
Implications, use cases, and how I would use Laravel Rust
Let’s take a step back and ask what this means for how we pick stacks in 2027 and beyond.
For years you had to pick between 2 worlds. You picked Rails, Django or Laravel PHP when you wanted to ship a complete SaaS product fast as a solo developer or small team. You picked Rust or Go when you needed raw throughput, tiny memory footprints, and strict compile-time guarantees, and you accepted writing a lot more glue code.
Laravel Rust collapses that choice. You get single-binary compiled speed (18x faster than PHP in Laravel’s tests, 6,000+ RPS locally on SQLite), strict compile-time validation of your routes, models, inputs, and secrets, durable workflows without Temporal, and a full Inertia + React + Tailwind + Reverb stack out of the box.
How I would use Laravel Rust
Here is my honest take on where I would reach for Laravel Rust right now, and where I would still pause.
- New SaaS products and APIs: Once Laravel Rust hits 1.0 (the team expects roughly six to eight weeks of beta before calling it stable), I would default to Laravel Rust over Laravel PHP for every new full-stack app I build. Between coding agents reading the bundled
.agents/skills/docs and Rust’s compiler catching entire classes of bugs before deployment, I get better speed, cheaper hosting bills, and stronger safety without giving up Laravel’s productivity. - High-throughput backends, webhooks, and monitoring services: Anything that ingests constant webhooks, proxies APIs, runs concurrent background checks (like Pingwatch), or holds open thousands of WebSocket connections is a natural fit for Axum + Tokio. A single small instance handles traffic that would take a whole cluster of PHP workers.
- Long-running business flows: The built-in durable workflows (
#[workflow]) make multi-day onboarding sequences, payment retries, approval gates, and AI agent pipelines dramatically simpler than managing delayed queue chains by hand. - Gradual offload for existing Laravel PHP apps: If I were running a mature Laravel PHP SaaS with expensive hot endpoints, I would not rewrite the whole app. I would spin up a companion Laravel Rust service on Laravel Cloud pointing at the same PostgreSQL or MySQL database and move the heaviest routes or webhook processors over first.
Where Laravel Rust is not the right fit (yet)
A few limits are worth knowing before you switch:
- It is still a
0.1beta. APIs and config formats can break before 1.0. If you are launching a mission-critical production app next Tuesday and cannot absorb a few breaking beta updates over the next two months, stick with Laravel PHP 13 for now or isolate Rust to a non-critical service. - Cold CI and Cloud builds take ~3 minutes. If your team pushes thirty tiny copy tweaks a day directly to production without build caching, a 3-minute Rust compile feels noticeably slower than a 27-second PHP deploy.
- PHP package ecosystem maturity. Laravel PHP has fifteen years of community packages (Filament, Nova, Cashier, Spatie’s entire catalog, and now Converse and Agent Kit). Laravel Rust has near feature parity on core framework primitives, and packages will grow quickly, but if your business depends on Filament admin panels today, PHP still wins.
- Static sites and edge micro-workers. For a content site like
flaviocopes.com, Astro stays simpler and faster at the edge. For tiny globally distributed edge endpoints, Cloudflare Workers still beat a regional origin server.
Even with those caveats, today feels like a turning point. Laravel took the best developer experience in web development, stripped away the legacy weight, kept every convention that makes shipping fast, and put it on top of Rust, Axum, Tokio, and SQLx.
If you have ever wanted to build with Rust without spending a week wiring up auth, validation, queues, and tests, install the new laravel CLI, run laravel new my-app --rust, and try building a small service with it.
Want me to talk about your product? You can sponsor this site.
Related posts about laravel: