Larust
A Laravel-shaped web framework for Rust. Real, compiled, type-checked Rust underneath - the directory layout, routing style, validation, templates, and CLI a Laravel developer already knows.
app/Http/Controllers, routes/web.rs, Blade-flavored templates, an xr CLI shaped like artisan.
Axum, sqlx, tower-sessions - no interpreter, no magic methods, no runtime you have to trust to catch your mistakes.
@wire(...) components and @live(...) server push - Livewire-shaped, with a vendored, dependency-free client runtime.
Larust is an independent, community project inspired by Laravel’s design. It is not affiliated with, endorsed by, or sponsored by Laravel LLC, Taylor Otwell, or the Laravel project.
The pitch
Open a generated Larust app and you should recognize almost everything if
you’ve ever worked in Laravel: the directory layout, the routing style,
form validation, Blade-flavored templates, the ORM’s vocabulary, the xr
command-line tool. The names are deliberately familiar.
What’s underneath is not. There is no PHP, no interpreter, no $this, no
magic methods, and no runtime you have to trust to catch your mistakes for
you. Every route, every model, every validated field is real, compiled,
type-checked Rust - built on Axum for
HTTP, sqlx for the database, and
tower-sessions for
sessions. If it compiles, whole categories of runtime surprise Laravel
developers are used to bracing for - a typo’d array key, a null where an
object was expected, a route that silently 500s in production because a
relationship wasn’t eager-loaded - simply cannot happen the same way.
Larust is for two audiences at once, and it’s written to be legible to both:
- Coming from Laravel? Read Coming from Laravel first - it maps everything you already know onto its Larust equivalent, and is explicit about the handful of things that are deliberately not carried over (magic, mostly).
- Coming from Rust? Read Coming from Rust first - it explains why this framework makes the opinionated choices it does (a batteries-included web framework, not a pile of composable crates you assemble yourself), and where the Laravel-shaped naming might throw you if you already know Axum or sqlx directly.
Either way, Getting Started is the fastest path to a real, running app.
Choose your next step
The reference is organized around the job you want to do, rather than the framework crate that happens to implement it.
| If you want to… | Start here | Then read |
|---|---|---|
| Run a fresh app | Installation | Your First App |
| Understand a complete feature end to end | Build a Posts Feature | The Basics |
| Translate familiar Laravel code | Coming from Laravel | the linked Larust reference page |
| Use Larust from a Rust-first perspective | Coming from Rust | Architecture Overview |
| Find a command, option, or lifecycle action | CLI Reference | Deployment & Desktop Apps |
Prefer the shortest useful path. The guided feature page is intentionally small and complete; each step links to the deeper reference only when you need to change the pattern. This is the same “learn the happy path, then open the focused reference” rhythm that makes component-framework documentation easy to follow.
A map, if you already know Laravel
| Laravel | Larust |
|---|---|
php artisan |
xr |
composer create-project laravel/laravel |
xr new |
routes/web.rs / routes/api.rs |
routes/web.rs / routes/api.rs (same idea, real Rust) |
Route::get(...)->name(...) |
Route::get(...).name(...) |
app/Http/Controllers |
app/Http/Controllers |
Form Requests ($request->validated()) |
#[derive(FormRequest)] + request.validated() |
| Eloquent models | #[derive(Model)] + QueryBuilder |
hasMany/belongsTo/belongsToMany |
#[has_many(...)]/#[belongs_to(...)]/#[belongs_to_many(...)] |
Blade (.blade.php) |
.blade.xr (parsed by view!, not a runtime template engine) |
| Policies | Policy<U> + authorize() |
| Sanctum | larust-sanctum |
| Jobs / Queues | larust-queue (SQLite or Redis) |
| Task Scheduling | larust-scheduler |
| Notifications | larust-notifications |
| Events & Listeners | larust-events |
| Livewire | @wire(...) components (larust-live) |
| Broadcasting | @live(...) + larust-reverb |
php artisan tinker |
not yet - see FAQ |
.env |
.env (same format, same idea) |
See Coming from Laravel for the full, honest version of this table - including what’s different on purpose.
What’s actually in the box
- Routing - a
Route/RouterDSL over Axum, named routes, resource routing, group-scoped middleware, route model binding. - Validation -
#[derive(FormRequest)], 422 JSON responses before your handler ever runs. - Templates - a from-scratch Blade-inspired parser (
.blade.xr,@extends/@section/@if/@foreach/@push/@stack, components, layouts) compiled to real Rust at build time, not interpreted per request. - Image optimization -
<Image src="..." width="..." height="..." />, Next.js-shaped: on-demand resize + AVIF/JPEG re-encoding, cached after the first request, core surface with no feature flag to enable. - The ORM -
#[derive(Model)], aQueryBuilder, migrations, and every relationship kind with eager loading, over SQLite, MySQL, Postgres, and (partially) SQL Server. - Auth - password hashing, session guards,
Auth<U>,Policy<U>, API tokens (larust-sanctum), roles/permissions, social login (larust-socialite), and a full OAuth2 authorization server (larust-passport) for issuing tokens to third-party clients of your own API. - Reactivity, without a SPA build step -
@wire(...)components (Livewire-shaped, server-state-backed) and@live(...)for genuine server-pushed real-time updates, both with a vendored, dependency-free client runtime. - Everything else Laravel apps end up needing - mail, notifications, events, queues (SQLite or Redis), a scheduler, file storage, caching (SQLite or Redis), an embedded key-value store with an admin dashboard, sitemaps, feature flags, full-text search (Meilisearch), subscription billing (Stripe), and a plugin trait for packaging your own routes. See Optional Features for the complete, current list.
- The
xrCLI -new,dev(rebuild + restart + browser auto-reload on save, zero downtime),deploy,make:*generators,route:list,migrate,queue:work,schedule:work,convert(bring an existing Laravel app over),audit,upgrade.
See the CLI reference and the Digging Deeper section for the full tour, or docs/ARCHITECTURE.md in the repository for the engineering-diary-level detail behind every one of these decisions.
Status
Every milestone in the project’s history is implemented, covered by tests, and has been through an independent review pass - see docs/MILESTONES.md in the repository for the full, chronological build log. This site is the reference documentation; that file is the changelog.
Every Larust crate is published to crates.io. xr new/xr convert still
generate apps that resolve the framework’s own crates as local path
dependencies against a checkout of this repository, though - that part of
the crates.io migration is still in progress - see
Installation for exactly what that means
in practice today.