# Migrating from PHP (laravel-rust-barcode)

> Map milon/barcode's linear SVG and HTML calls to the Rust encoder and renderer.

- Package: laravel-rust-barcode (Laravel for Rust, alpha), crates: `laravel-rust-barcode`, `laravel-rust-barcode-core`
- Maintenance: active; Latest release: 0.1.0 (2026-12-05); Framework: laravel-rust 0.2.x; MSRV: Rust 1.99 or later; Licence: MIT
- Links: [Repository](https://github.com/bowerbird-si/laravel-rust-barcode), [crates.io](https://crates.io/crates/laravel-rust-barcode/0.1.0), [docs.rs](https://docs.rs/laravel-rust-barcode/0.1.0), [Changelog](https://oss.bowerbird.si/barcode/docs/changelog/), [Contributing](https://github.com/bowerbird-si/laravel-rust-barcode/blob/3cc853b5abd7af2bf6028407dda457fb69bdf231/CONTRIBUTING.md), [Security policy](https://github.com/bowerbird-si/laravel-rust-barcode/blob/3cc853b5abd7af2bf6028407dda457fb69bdf231/SECURITY.md)
- Based on: [milon/barcode](https://github.com/milon/barcode): The PHP package whose behaviour this package independently implements, following version 13.6.0.
- PHP parity: full (66 covered, 13 diverged, 0 planned of 79 abilities; 205 fixtures; follows milon/barcode v13.6.0; verified 2026-12-05)
- Community package, not affiliated with Laravel.
- HTML version: https://oss.bowerbird.si/barcode/docs/migrating-from-php/
- Source: https://github.com/bowerbird-si/laravel-rust-barcode/blob/3cc853b5abd7af2bf6028407dda457fb69bdf231/docs/migrating-from-php.md

Map milon/barcode's linear SVG and HTML calls to the Rust encoder and renderer.

| PHP | Rust |
| --- | --- |
| Type string | `type_name.parse::<Linear>()?` accepts the same names without regard to ASCII case |
| `getBarcodeSVG` | `kind.encode(code)?.svg(label, inline, options)?` |
| `getBarcodeHTML` | `kind.encode(code)?.html(label, options)?` |
| `setPadding` | `LinearRenderOptions::new().padding(pixels)` |

Code 39 Full ASCII (`C39E`, `C39E+`) preserves lowercase letters and encodes the vertical tab byte
`0x0B`. Plain Code 39 continues to uppercase ASCII letters.

Code 93 preserves lowercase and the vertical tab as well. Codabar preserves a caller-supplied
start or stop letter and supplies `A` at a missing end. Interior delimiter letters are rejected.

Industrial and Interleaved 2 of 5 require at least one digit, with or without a check digit.


Matrix PNG files use the same bounds and pixels as the in-memory renderer, without PHP's edge
overdraw. Invalid QR error-correction levels return an error instead of falling back.

Single-track Pharmacode returns an error for zero, negative, non-numeric or out-of-range values
instead of producing a blank symbol.
