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

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>@endif

Render 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, &lt;Ada&gt;!</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