Testing | laravel-translatable-rust | Spatie       

 SPATIE  

laravel-translatable-rust
=========================

spatie.be/open-source

  [Docs](https://spatie.be/docs)  [Laravel-translatable-rust](https://spatie.be/docs/laravel-translatable-rust/v1)  Testing

 Version   v1      

 Other versions for crawler [v1](https://spatie.be/docs/laravel-translatable-rust/v1) 

  Testing    
- [ Introduction ](https://spatie.be/docs/laravel-translatable-rust/v1/introduction)
- [ Support us ](https://spatie.be/docs/laravel-translatable-rust/v1/support-us)
- [ Requirements ](https://spatie.be/docs/laravel-translatable-rust/v1/requirements)
- [ Upgrading ](https://spatie.be/docs/laravel-translatable-rust/v1/upgrading)
- [ Installation &amp; setup ](https://spatie.be/docs/laravel-translatable-rust/v1/installation-setup)
- [ Questions and issues ](https://spatie.be/docs/laravel-translatable-rust/v1/questions-issues)
- [ Changelog ](https://spatie.be/docs/laravel-translatable-rust/v1/changelog)
- [ Testing ](https://spatie.be/docs/laravel-translatable-rust/v1/testing)
- [ About us ](https://spatie.be/docs/laravel-translatable-rust/v1/about-us)

Basic usage
-----------

- [ Getting and setting translations ](https://spatie.be/docs/laravel-translatable-rust/v1/basic-usage/getting-and-settings-translations)
- [ Removing translations ](https://spatie.be/docs/laravel-translatable-rust/v1/basic-usage/removing-translations)
- [ Replacing translations ](https://spatie.be/docs/laravel-translatable-rust/v1/basic-usage/replacing-translations)
- [ Querying translations ](https://spatie.be/docs/laravel-translatable-rust/v1/basic-usage/querying-translations)
- [ Validating translations ](https://spatie.be/docs/laravel-translatable-rust/v1/basic-usage/validating-translations)
- [ Handling missing translations ](https://spatie.be/docs/laravel-translatable-rust/v1/basic-usage/handling-missing-translations)

Advanced usage
--------------

- [ Available events ](https://spatie.be/docs/laravel-translatable-rust/v1/advanced-usage/available-events)
- [ Serializing translations ](https://spatie.be/docs/laravel-translatable-rust/v1/advanced-usage/customize-the-toarray-method)
- [ Usage with factories ](https://spatie.be/docs/laravel-translatable-rust/v1/advanced-usage/usage-with-factories)

 Testing
=======

Run these checks from the package directory:

```
cargo fmt --all -- --check
cargo clippy --locked --workspace --all-targets --all-features -- -D warnings
cargo test --locked --workspace --all-targets --all-features
cargo test --locked --workspace --doc --all-features
cargo doc --locked --workspace --no-deps --all-features
```

Set `RUSTDOCFLAGS` to `-D warnings` when running the documentation commands. In POSIX shells, prefix each command with `RUSTDOCFLAGS='-D warnings'`. In PowerShell, first run `$env:RUSTDOCFLAGS = '-D warnings'`.

Run `./scripts/check` for all package checks and the runnable `news` example. Tests boot the real framework, migrate SQLite with `db::migrations!`, and use real model creates, JSON casts, typed updates, queries, pagination, providers, and event listeners. Native `#[laravel::test]`, `refresh_database`, and `event::fake` check event payloads, translation maps, and locale unions. A custom application model persists on its named connection while the default connection has no translation table. A file-backed test drops and reopens the application to verify persisted translations and migration history.

Check the minimum supported Rust version:

```
rustup toolchain install 1.99.0 --profile minimal
cargo +1.99.0 test --locked --workspace --all-targets --all-features
cargo +1.99.0 test --locked --workspace --doc --all-features
```

Check security advisories:

```
cargo install cargo-audit --locked
cargo audit
```

Install `cargo-machete` with `cargo install cargo-machete --locked`, then run `./scripts/audit` to check both security advisories and unused dependencies. An audit requires access to the RustSec advisory database.

CI runs stable checks on Linux, macOS and Windows, and separate MSRV and audit jobs on Linux.

- Public Git dependencies need no credentials. CI optionally uses `SPATIE_GITHUB_TOKEN` when configured.
- The README and database guides run against isolated in-memory SQLite databases during doctests. Their hidden setup uses the same model, migrations, and application as the `news` example.
- Rustdoc and Clippy reject warnings, including missing public documentation and pedantic Clippy checks.
- Publishing to crates.io remains disabled; no release step runs.

 A good
match?
-------------

### What we do best

- All things Laravel
- Custom frontend components
- Building APIs
- AI-powered features
- Simplifying things
- Clean solutions
- Integrating services

### Not our cup of tea

- WordPress themes
- Cutting corners
- Free mockups to win a job
- "Just execute the briefing"

 In short: we'd like to be a **substantial part** of your project.

 [ Get in touch via email ](mailto:info@spatie.be?subject=A%20good%20match%21&body=Tell%20us%20as%20much%20as%20you%20can%20about%0A-%20your%20online%20project%0A-%20your%20planning%0A-%20your%20budget%0A-%20%E2%80%A6%0A%0AAnything%20that%20helps%20us%20to%20start%20straightforward%21)
