oxblade
Oxblade matches Laravel 13's HTML byte for byte on all 971 paired conformance cases in CI. The
expected output comes from Laravel 13.39.0 itself. Separate suites check 181 pagination fixtures,
six Markdown emails in HTML and text, and 4,523 translation records. See the
parity matrix for documented differences. Templates use Rust-style
expressions such as user.name, items.len() and |c| c.score >= 80.
Quick start
[]
= "0.1"
= "1"
use ;
use json;
It prints:
Books
Middlemarch classic
Tom & Jerry's <Guide>
The same program is crates/oxblade/examples/quickstart.rs; CI
builds and runs it. In a Laravel for Rust app, oxblade-laravel registers the engine and views load from
resources/views; see the guide.
Blade, with Rust expressions
Templates use Blade markup and directives with Rust-style expressions.
| PHP Blade | oxblade |
|---|---|
{{ $user->name }} |
{{ user.name }} |
@foreach ($posts as $post) |
@foreach (post in posts) |
@if ($posts->isEmpty()) |
@if (posts.is_empty()) |
{{ $items->count() }} |
{{ items.len() }} |
<x-alert :type="$level" /> |
<x-alert :type="level" /> |
@php … @endphp |
@code … @endcode, with Rust statements |
{{ number_format($price, 2) }} |
{{ number_format(price, 2) }} |
Conditions must be bool, nothing converts implicitly, and integer division is Rust's. Where a template
needs PHP's exact behaviour, the php:: functions from
laravel-rust-format provide it. Laravel's
collection, string, number and date helpers are available under their Laravel names.
What it covers
- Laravel 13's Blade: its directives, template inheritance, components (anonymous, class and inline),
slots,
@aware, stacks,@once,@verbatim,@json,@js, custom directives and conditions, view composers, pagination views and the mail Markdown components.@fontswaits on the framework. The parity matrix lists every feature and how oxblade handles it. - Translations:
__(),trans(),trans_choice(),@langand@choice, with Laravel's replacements and plural rules for 280 locales. The adapter loads the app'slang/directory and uses the request's locale. - Laravel for Rust integration in
oxblade-laravel: a view engine and service provider,route(),url(),asset(),@auth/@can, CSRF and method fields, andblade:check. - Type checking:
checkvalidates templates against the Rust view models that render them, in CI. - Migration from PHP Blade: the
oxbladecommand (oxblade-cli) converts.blade.phpviews, marks what needs a person withTODOcomments, replays later PHP changes as diffs, and converts PHP language files withoxblade lang. - Limits: output size, loop iterations, collection expansion and nesting depth are bounded
per core render. The core expression language provides no direct file or environment access.
The Laravel adapter's
config(key)allowsapp.name,app.env,app.url,app.debugand keys the app explicitly exposes.
How output is checked
Each case in conformance/cases pairs a PHP Blade template with an oxblade
template and shared input data. CI reruns the PHP oracle to check the stored output, then compares
oxblade's render with that output. Case notes explain any deliberate adjustments to the pair.
353 tests · 6 fuzz targets (counted by kit readme)
Installation and configuration
See the guide.
Compatibility
| Crate | Framework | MSRV |
|---|---|---|
oxblade |
none | 1.99 |
oxblade-macros |
none | 1.99 |
oxblade-laravel |
laravel-rust 0.2 |
1.99 |
oxblade-cli |
none | 1.99 |
oxblade-mail |
none | 1.99 |
The adapter requires laravel-rust 0.2.0 or later within the 0.2 series. The lockfile and CI tests
use 0.2.0.
Contributing
Issues and pull requests are welcome, of any size: bug reports, failing test cases, docs fixes, new
features. A template that renders differently from Laravel is the most useful bug report: send the
.blade.php file, its data and both outputs. Contributions written with AI coding agents are welcome too;
please say what you checked. Run scripts/kit ci before opening a pull request, and see
CONTRIBUTING.md. If you aren't sure, open an issue first.
Credits
- Laravel's Blade (MIT): the syntax, directives and behaviour, measured against Laravel itself. Laravel's pagination views and mail components and themes are adapted as files and keep Laravel's licence notice.
- laravel-rust-format: Laravel's string, number and
date helpers and the
php::functions. - rustblade (MIT OR Apache-2.0): ideas such as trusted HTML only
in
{!! !!},formatas Rust'sformat!, and migration withTODOmarkers. - blade-syntax (MIT OR Apache-2.0): lexing rules for Blade's edge cases.
- MiniJinja: the speed baseline.
Status and licence
Version 0.1.0 is prepared as the first alpha release. Maintenance is active. See the MIT licence and upstream credits.
Community package, not affiliated with Laravel.