Laravel for Rust Alpha
oxblade
Laravel's Blade templates with Rust-style expressions.
Oxblade matches Laravel 13.39.0 byte for byte on all 977 paired conformance cases in CI. Separate suites check pagination views, Markdown mail and translations. Templates use Rust-style expressions such as user.name, items.len() and |c| c.score >= 80.
Read the docs Source on GitHub
cargo add oxblade@0.2 serde_json@1- Latest release
- 0.2.0, 2026-12-05
- Maintenance
- Active
- Framework
- laravel-rust 0.2.x
- MSRV
- Rust 1.99 or later
- Licence
- MIT
Laravel is the oracle
The conformance suite compares output bytes from paired templates rendered by oxblade and Laravel 13.39.0.
Blade, with Rust expressions
Templates use Blade markup and directives. Conditions require
booland conversions are explicit. Use thephp::functions for PHP behaviour.Components with typed props
Anonymous, class and inline components, named slots,
@awareand attribute bags, with props declared as@props(tone: String = 'info').Laravel for Rust integration
oxblade-laravelregisters the engine and bringsroute(),asset(),@auth,@can,@csrf, translations, pagination views and Markdown mail.Checked in CI
blade:checkvalidates templates against the Rust view models that render them.Migrate from PHP Blade
oxblade migrateconverts.blade.phpviews and marks what needs a person withTODOcomments;oxblade langconverts PHP language files.Bounded renders
Render limits cover output size, loop iterations, collection expansion and nesting depth. The Laravel adapter exposes configuration through an explicit allow-list.
In practice
Blade and oxblade side by side
Both templates iterate through posts and display a fallback when the list is empty.
{{-- PHP Blade --}}
@foreach ($posts as $post)
<x-card :title="$post->title">{{ $post->excerpt }}</x-card>
@endforeach
@if ($posts->isEmpty())<p>No posts yet.</p>@endif
{{-- oxblade --}}
@foreach (post in posts)
<x-card :title="post.title">{{ post.excerpt }}</x-card>
@endforeach
@if (posts.is_empty())<p>No posts yet.</p>@endifRender a view
Views can come from memory, as here, or from .blade.html files with FilesystemLoader.
use oxblade::{engine::Environment, loader::MemoryLoader};
use serde_json::json;
let views = MemoryLoader::new()
.view("layouts.app", "<main>@yield('content')</main>")
.view("hello", "@extends('layouts.app')\n@section('content')Hello, {{ name }}!@endsection");
let env = Environment::builder(views).build();
let html = env.render_json("hello", &json!({ "name": "<Ada>" }))?;
assert_eq!(html, "<main>Hello, <Ada>!</main>");Built on
- Laravel Blade: The template language this package implements: Blade's markup, directives and rendered HTML (illuminate/view, MIT).
Crates: oxblade, oxblade-laravel, oxblade-macros, oxblade-mail, oxblade-cli
Documentation
- OverviewOxblade matches Laravel 13's HTML byte for byte on all 977 conformance cases in CI. Laravel 13.39.0 generates the expected bytes for every case.
- Getting startedAdd the oxblade engine and Serde JSON to render Blade templates with JSON data in a standalone Rust program.
- Moving Blade views from PHP Laravel to Laravel for RustThis guide moves one page, with its layout and a component, from a PHP Laravel app to a Laravel for Rust app that renders with oxblade. The markup stays as it…
- CLI referenceThe oxblade command converts PHP Blade views and language files, replays later view changes and summarizes migration reports.
- Template safetyKeep templates and view roots under application control. Treat values from requests, users and external services as untrusted data.
- ChangelogWhat changed in each release of oxblade: additions, changes and fixes.