Today we are releasing the first beta of Laravel Rust, bringing the full-stack philosophy and feature set of Laravel to Rust, including routing, middleware, sessions, authentication, database models, queues, mail, workflows, and testing helpers.

Laravel Rust is not a blind port of Laravel to Rust. It is Laravel reimagined in idiomatic Rust for a modern, high-performance stack, thoughtfully curated for a great developer experience when building with AI. Every new application ships with built-in agent skills that guide coding agents on how to write and test idiomatic Laravel Rust code.

Laravel Rust is built with the forward-looking perspective that humans will increasingly neither write nor manually read application code at scale. In that world, strong guardrails, strict compilers, and batteries-included conventions matter more than ever.

Laravel Rust brings the battle-tested conventions, philosophy, and productivity of Laravel to Rust as a high-performance full-stack framework built to thrive in the AI age, giving you a solid foundation to build the most ambitious, mission-critical web applications of the future.

Today, Laravel Rust is near feature parity to Laravel PHP, and the small gaps that remain will be closed within the coming weeks.

There is far too much in this release to cover in a single blog post, so the sections below walk through only some of the highlights. To explore everything Laravel Rust includes, from authentication, encryption, and file storage to task scheduling, console commands, and package development, dig into the full Laravel Rust documentation.

In our internal benchmarks on Laravel Cloud, Laravel Rust runs 18x faster than Laravel PHP while using significantly less CPU and memory, significantly decreasing infrastructure cost, tail latency, and increasing how much traffic a single instance can absorb during a spike.

Laravel Rust is built end-to-end on Axum and Tokio, so the entire stack is asynchronous at its core: HTTP handlers, middleware, database queries, the HTTP client, Redis, queues, S3, SQS, and WebSockets are all non-blocking, and blocking work such as bcrypt password hashing and local disk I/O is offloaded onto Tokio's blocking thread pool. When one request waits on a slow database query, a third-party webhook, or a long-running AI API call, those same threads keep serving thousands of other requests, background tasks, and queue jobs without stalling.

Rust's type system unlocks huge improvements across the framework. Database column names, relationships, validated form inputs, authorization checks, and secret values are verified at compile time before your code reaches production.

#Routing and handlers

When someone visits a page or submits a form, Laravel matches the request against the routes you register in src/routes/web.rs and src/routes/api.rs. You can start with inline closures, use route model binding to load a record directly from a URI segment, and move larger endpoints into handler modules under src/http/handlers/:

原文来源:laravel.com