Your first Laravel Rust app: install, structure, and the build times nobody mentions
Published December 2, 2026 · by Majd Ghithan, written with the help of AI
If you've run laravel new a hundred times, the first ten minutes of Laravel Rust feel familiar. Then you hit your first cold build, and you remember you're in a compiled language now.
This is a walkthrough of getting a first app running, based on the official installation, structure, development and routing docs. Laravel Rust is in beta (0.1.x), and the docs say releases before 1.0 "may include breaking changes to APIs and configuration", so check the docs before copying anything into a real project.
What you need
According to the installation docs, you need Rust, Node.js and Git, and "Laravel needs Rust 1.99 or later."
Laravel ships a new installer for its CLI:
curl -fsSL https://laravel.com/install.sh | sh
It puts the laravel command in ~/.laravel/bin. One gotcha: Herd and the older Composer-based installer also provide a laravel command, so check which one you're running with laravel --version. The output should start with "Laravel CLI".
Create and run the app
laravel new example-app --rust
cd example-app
Then run the migrations and start everything:
laravel migrate
laravel dev
laravel dev starts your application, a queue worker, and Vite Plus all at once. Visit http://127.0.0.1:8000. There's also a health check at /up. To try a production build locally, run npm run build then cargo run --release.
Out of the box you get Inertia, React, TypeScript, Tailwind and Vite Plus, so the frontend side will feel like a modern Laravel starter kit.
The project structure
The root will look partly familiar: database/migrations/, database/seeders/, resources/, public/, storage/, tests/. The new pieces are Rust's: Cargo.toml and build.rs. The docs explain build.rs well: it "Rebuilds your application when you add a migration, because your migrations compile into the binary."
Inside src/:
app.rsconfigures the app, next tomain.rs,lib.rsandtesting.rsroutes/withweb.rs,api.rsandchannels.rshttp/handlersandhttp/middlewaremodels/,config/(database.rs,cors.rs,services.rs),console/,events/,listeners/
Your application's library is always named app.
One line from the structure docs deserves a sticky note on your monitor: "If you forget a mod line, Rust skips the file without a warning, and nothing in it runs." Coming from PHP autoloading, this is the mistake I expect every Laravel developer to make in week one. You create a file, nothing happens, no error. Check your mod lines first.
Routing and a handler
Route files are functions that receive a Router. They live in src/routes and are registered in src/app.rs. Routes in web.rs get sessions, encrypted cookies and CSRF protection. Routes in api.rs are stateless and get the /api prefix. Same split you know from PHP.
Here's route model binding, straight from the routing docs:
use crate::models::User;
pub fn routes(route: &mut Router) {
route.get("/users/{user}", async |user: User| user.name);
}
The closure takes a User, so Laravel loads the user whose ID is in the URI. If no user has that ID, Laravel responds with a 404. Exactly the behavior you'd expect from Laravel PHP.
For anything bigger than a closure, Laravel Rust uses handlers, not controllers. The docs define them as "an async function that handles a request", with related handlers grouped in a module under src/http/handlers. A handler that renders a server-side view looks like this:
use laravel::prelude::*;
use laravel::view::View;
pub async fn show() -> View {
view("greeting", data! { name => "James" })
}
The view is a .html file in resources/views, written in Jinja syntax, and every value is HTML-escaped automatically. Most new apps will lean on Inertia and React instead, but it's good to know plain server-rendered pages are there.
And since you'll ask: middleware is "an async function marked with #[middleware]" that receives the request and next:
use laravel::http::{Next, Request, Response, middleware};
#[middleware]
pub async fn ensure_token_is_valid(request: Request, next: Next) -> laravel::Result<Response> {
if request.header("x-api-token") != Some("my-secret-token") {
laravel::abort!(403);
}
Ok(next.run(request).await)
}
If you've written Laravel middleware, you can read this without knowing Rust.
Build times, honestly
This is the part the launch posts don't hide, and neither will I. Laravel's own Cloud post says: "There's a catch, and it's build time."
That's 3m 1s for Laravel Rust against 27s for Laravel PHP, with the slowest Rust build at 6m 4s. Locally, on an Apple M4 Pro, the cold dev build median was 19.4s, and an incremental rebuild after adding a small /foo endpoint was a median of 1.1s. The benchmark post adds that "these timings will be longer in larger applications", and those numbers come from a tiny app.
Watch your disk too. The development docs warn that "compiled artifacts can grow to tens of gigabytes on disk". New apps share a build cache at ~/.cargo/build/laravel-rust to soften that.
So the day-to-day loop is fine. The first build, and CI and deploy builds, are where you feel it.
My take
Walking through the docs for a first app felt a lot like my early laravel new days: familiar commands, familiar folders, routes that read like Laravel. The two things to prepare for are the compiler's pace on cold builds and the missing mod line trap. Start with a small tool, keep PostgreSQL running, give your disk some room, and treat it as beta. Next in this series, I'll get into models and why the ORM refuses to hide N+1 queries from you.
