Laravel Rust in Practice: a Book That Builds a Real Blog with Laravel for Rust
Laravel now runs on Rust, with the names you already know. My third book builds a complete blog with it, from laravel new to your own server, and shows where those familiar names behave differently.
A few days ago Laravel arrived in Rust. Not a framework inspired by Laravel, but Laravel itself: laravel new, models and migrations, Form Requests, queues, mail, the scheduler, feature tests, with documentation written in the same style as the one we all learned from. For a Laravel developer that changes the question. It's no longer "should I learn a different way of building web apps". It's "how does the way I already know work in Rust, and where does it behave differently".
So I built a real application with it and wrote down everything on the way. The result is my third book, Laravel Rust in Practice.
One blog, from laravel new to a server
The book builds a single application end to end: a blog called Rust Notes. Posts with Markdown, tags, an admin with uploads and validation, subscribers and queued mail, a weekly digest on a schedule, RSS and a sitemap, caching and SEO, live search with htmx, live comments over WebSockets, double opt-in subscriptions on a durable workflow, a JSON API with tokens, an author's dashboard in React with Inertia, 78 tests, and a deploy with Docker Compose and Caddy on your own server.
Every chapter is one step, and every step is a git tag in the public repository axvilab/laravel-rust-in-practice, so you can check out exactly the code a chapter describes.
Familiar names, unfamiliar behaviour
Laravel for Rust keeps Laravel's names wherever it can. That's what makes it easy to start, and it's also where the surprises hide. I checked every step twice: the tests pass, and every page, form and button was clicked through in a browser. The second check found most of what's interesting:
- links in templates that pointed at the wrong page, because a model passed to a template is just data;
- a Back button that emptied the search page after an htmx request;
- a whole page appended inside the comment list, because htmx silently followed a validation redirect;
- a migration that would have dropped every existing subscriber the moment a "confirmed" column appeared;
- a first Dockerfile that sent the production
.envinto the build, and ports that were open to the world.
Each one is in the chapter where it happened, with the fix and the reason a Laravel developer wouldn't expect it.
A book that follows the framework
Laravel for Rust is in beta and moves fast: five releases in its first three days. A book about it is only useful if it keeps up, so this one does. Each new release is checked against the blog, every step is rebuilt and tested on it, and the chapters are revised where something changed. On Leanpub every update is free for everyone who has the book.
Who it's for
Laravel developers who want to build with Laravel for Rust. You don't need to know Rust well: every Rust construct is explained the first time the blog needs it. If you'd like a proper foundation in the language first, that's what Rust for Laravel Developers is for.
Getting it
The introduction and the first three chapters are a free sample: installing the framework, the posts model and the public pages. The full book is on Leanpub, in PDF and EPUB.