--- name: upgrading-laravel-rust description: Upgrades a Laravel for Rust application to the latest (or a specified) laravel-rust release, reads the new version's bundled upgrade guide, applies all applicable breaking-change migrations, and verifies clippy and the test suite. Use when asked to upgrade, update, or bump Laravel for Rust / laravel-rust. --- # Upgrading Laravel for Rust Follow these steps in order whenever upgrading `laravel-rust` in a Laravel for Rust application. ## 1. Record the Current Version Check the currently resolved version of `laravel-rust` before changing `Cargo.toml` or `Cargo.lock`: ```sh cargo pkgid laravel-rust ``` (If `Cargo.lock` does not exist yet or the application itself is named `laravel-rust`, check the `laravel-rust` entry in `Cargo.toml` and `Cargo.lock` directly.) Note this starting version so you know which release sections of the upgrade guide apply, and check whether `laravel-rust` resolves to a local `path+file://...` override (for example, via `.cargo/config.local.toml`, `.cargo/config.toml`, or `[patch.crates-io]` in `Cargo.toml`). ## 2. Upgrade `laravel-rust` If `laravel-rust` is **not** locally patched via `[patch.crates-io]`: 1. Find the latest published version on crates.io (or use the specific version the user asked for, such as `0.2.0`): ```sh cargo info laravel-rust ``` 2. Update the `laravel-rust` dependency: - For a patch upgrade within the same `0.x` minor series (for example, `0.1.5` → `0.1.6`), `cargo update -p laravel-rust` is enough. - For a minor or major upgrade across `0.x` series (for example, `0.1` → `0.2`), Cargo's semver rules will **not** cross minor versions automatically—update the `version` requirement in `Cargo.toml` (for example, `version = "0.2"`), preserving the application's existing `features = [...]` and any `default-features` setting, and then update the lockfile: ```sh cargo update -p laravel-rust ``` 3. Confirm the newly resolved version: ```sh cargo pkgid laravel-rust ``` If `laravel-rust` uses a local `[patch.crates-io]` override pointing at a local framework checkout, do not overwrite it unless the user explicitly asks to switch off the local patch; proceed directly to reading the patched checkout's `docs/upgrade.md`. ## 3. Read the Installed Upgrade Guide Locate the bundled documentation directory for the **newly installed** `laravel-rust` version: ```sh .agents/skills/writing-laravel-rust-apps/scripts/docs-path.sh ``` Read `/upgrade.md` in full. Always read it *after* bumping `Cargo.toml` and updating `Cargo.lock` so you are reading the new release's upgrade instructions, not the old version's. ## 4. Apply Applicable Changes in Order 1. Find every version section in `/upgrade.md` strictly newer than the starting version up through the new version. 2. Work through those sections **from oldest to newest** so multi-version jumps apply cleanly. 3. For each item in a section: - Search the application (`src/`, `database/`, `tests/`, `Cargo.toml`) using the item's search patterns. - Apply the migration wherever the codebase uses the changed API. Skip items that do not apply to this application. - Review any behavioral or default changes (such as config or middleware defaults) against `src/app.rs`, `src/config/`, `.env` / `.env.example`, and production settings, and call out anything the user should double-check in deployment environments. - Consult the relevant guide in `/` if you need full signature or behavior details for a migrated API. 4. Check `.agents/skills/` in this repository for any skill examples that reference changed APIs and update them to stay in sync. ## 5. Verify the Application Run formatting, Clippy, tests, and a quick CLI smoke check: ```sh cargo fmt cargo clippy --all-targets cargo test cargo run -- route:list ``` Fix any remaining compilation errors, Clippy warnings, or failing tests caused by the upgrade until everything passes cleanly. ## 6. Summarize the Upgrade Report clearly to the user: - The version upgraded from and to (`vX.Y.Z` → `vA.B.C`). - Each upgrade item that applied to this application and which files were updated. - Any behavioral/default changes worth reviewing in `.env` or production config. - Verification results (`cargo clippy`, `cargo test`).