# Getting started (laravel-rust-format)

> Install laravel-rust-format-core for Rust functions or laravel-rust-format for the Laravel for Rust provider and MiniJinja filters. Both require Rust 1.99 or…

- Package: laravel-rust-format (Laravel for Rust, alpha), crates: `laravel-rust-format`, `laravel-rust-format-core`
- Maintenance: active; Latest release: 0.1.1 (2026-12-04); Framework: laravel-rust 0.2.x; MSRV: Rust 1.99 or later; Licence: MIT
- Links: [Repository](https://github.com/bowerbird-si/laravel-rust-format), [crates.io](https://crates.io/crates/laravel-rust-format/0.1.1), [docs.rs](https://docs.rs/laravel-rust-format/0.1.1), [Changelog](https://oss.bowerbird.si/format/docs/changelog/), [Contributing](https://github.com/bowerbird-si/laravel-rust-format/blob/16e2c1a95c60fb32c5ee2f37b7d58a9f72be23f7/CONTRIBUTING.md), [Security policy](https://github.com/bowerbird-si/laravel-rust-format/blob/16e2c1a95c60fb32c5ee2f37b7d58a9f72be23f7/SECURITY.md)
- Based on: [Laravel Str, Number and Pluralizer](https://github.com/laravel/framework): The behaviour of Illuminate\Support\Str, Number and Pluralizer, as typed Rust functions with English defaults.; [Carbon](https://github.com/briannesbitt/Carbon): The calendar, formats and relative-time translations, on Jiff with an explicit clock instant. The generated locale tables credit the authors of each language file.; [Doctrine Inflector](https://github.com/doctrine/inflector): English inflection rules, generated into Rust tables.; [Portable ASCII](https://github.com/voku/portable-ascii): Transliteration tables for Str::ascii and Str::slug, generated into Rust tables.; [League CommonMark](https://github.com/thephpleague/commonmark): Reference behaviour for Markdown in the PHP oracle; Comrak renders Markdown in Rust.; [Ramsey UUID](https://github.com/ramsey/uuid): Reference behaviour for identifiers in the PHP oracle; the core builds them in Rust.; [Symfony UID](https://github.com/symfony/uid): Reference behaviour for identifiers in the PHP oracle; the core builds them in Rust.
- PHP parity: core (465 covered, 4 diverged, 3 planned of 472 abilities; 133,206 fixtures; follows illuminate/support 13.39.0; verified 2026-12-04)
- Used in production across multiple projects.
- Community package, not affiliated with Laravel.
- HTML version: https://oss.bowerbird.si/format/docs/getting-started/
- Source: https://github.com/bowerbird-si/laravel-rust-format/blob/16e2c1a95c60fb32c5ee2f37b7d58a9f72be23f7/docs/getting-started.md

Install `laravel-rust-format-core` for Rust functions or `laravel-rust-format` for the Laravel for Rust provider and MiniJinja filters. Both require Rust 1.99 or later. See [install](https://github.com/bowerbird-si/laravel-rust-format/blob/main/README.md#install) for the Git dependency before the first release.

## Format a number and a label

The modules follow their PHP equivalents. Rust uses snake case and keeps the integer or float type at the call site.

```rust
use laravel_rust_format_core::{php, str};

let amount = php::number_format(1234.5, 2).unwrap(); // "1,234.50"
let label = str::plural_with_count("city", 3); // "3 cities"

assert_eq!(amount, "1,234.50");
assert_eq!(label, "3 cities");
```

Use a builder for options such as Laravel’s `preserveWords`.

```rust
use laravel_rust_format_core::str::Limit;

let summary = Limit::new(8).end("…").preserve_words().apply("Visit Lisbon");
assert_eq!(summary, "Visit…");
```

## Use the helpers from a view

[Register the provider](https://oss.bowerbird.si/format/docs/laravel-integration/) and pass numbers, strings and dates in the view context. This MiniJinja template uses literal values so you can also paste it into a view as a smoke test.

```
{{ 1234.5|number_format(2) }} {# 1,234.50 #}
{{ "city"|str_plural(3) }} {# cities #}
```

The adapter re-exports the Rust functions at `laravel_rust_format::core`. You can format values in a view model and pass strings to the template, or call [the filters](https://oss.bowerbird.si/format/docs/templates/) directly.

Community package, not affiliated with Laravel.
