# Upgrade Laravel 11 to Laravel 13

An agent upgrades Laravel 11 to 13 using the official guide, runs Pest after each step, and opens a PR listing changes and open human decisions.

[Run this on Rush](https://cloud.getrush.ai/run/upgrade-framework-major/laravel/), in a Project that has your repository.

## What the agent does

For a Laravel app like laravelio/laravel.io, the agent starts from composer.json and the README. The portal requires PHP 8.4.*, laravel/framework ^11.5, Livewire ^3.3, livewire/flux ^2.1, Filament ^4.0, Sanctum, Scout, Socialite and a large Spatie set. Dev dependencies include pestphp/pest ^3.0 with pest-plugin-laravel and pest-plugin-livewire. README installation expects Composer, NPM, a MySQL database named laravel for the app and testing for the suite, then composer setup (key generate, migrate --seed, npm install, npm run build). Tests live under tests/Feature (ForumTest, AuthTest, ArticleTest, SettingsTest and more), tests/Unit and tests/Integration, bootstrapped via phpunit.xml with DB_CONNECTION=mysql and DB_DATABASE=testing.

The agent follows the Laravel 11 → 12 → 13 upgrade guides in order rather than jumping the constraint in one blind composer require. After each framework constraint bump it runs composer update for the touched packages, applies documented config, bootstrap and middleware renames, and runs vendor/bin/pest -p (the README’s parallel Pest command). Failures are fixed against the guide; when a change needs a product decision (for example a removed first-party package with no one-to-one replacement, or Filament/Livewire pairing choices), it records the decision in the PR instead of guessing.

Front-end tooling stays on Vite: package.json scripts are npm run dev and npm run build. The agent rebuilds assets when Blade or Flux views break the build and keeps Tailwind config changes minimal. Herd-specific notes in herd.yml are left alone unless paths break in the sandbox. Optional GitHub OAuth and Algolia Scout credentials from the README are not required for Pest if tests mock those paths; missing services are called out when a test cannot run without them.

The final pull request lists each guide step applied, each Pest run’s outcome, composer.lock changes and a section titled decisions left for a person. No silent major upgrades of Filament or Scout beyond what the Laravel upgrade requires unless tests force it and the description says why.

Feature tests such as ForumTest.php, AuthTest.php, ArticleTest.php and SettingsTest.php exercise Livewire and HTTP surfaces that often break across majors. The agent treats a red Pest file as a signal to re-read the matching upgrade-guide note for middleware, validation or mail changes before editing production code in app/.

## Start it with one API call

`POST https://api.prix.dev/o/{org}/sessions`

```json
{
  "agent": "claude",
  "input": "Upgrade this app from Laravel 11 to Laravel 13 following the official upgrade guide step by step. Run the tests after each step and fix what breaks. Open a pull request that lists each change and anything you left for a person to decide.",
  "resources": [
    {
      "url": "https://github.com/your-org/your-app"
    }
  ]
}
```

1. **Get an API key.** In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
2. **Send the request.** POST the body in request.json to https://api.prix.dev/o/{org}/sessions, with your repository as the resources URL. The run starts in its own cloud sandbox.
3. **Read what came back.** Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.

## What comes back

The pull request moves laravel/framework and related first-party packages to the Laravel 13 line, updates composer.lock, and includes the code and config edits from the upgrade guides. The description is a step log with Pest results and a clear list of human decisions.

A reviewer runs vendor/bin/pest -p on the branch (or trusts CI), checks PHP 8.4 compatibility claims against composer.json, and resolves each listed decision before merge. Session transcript output for composer and Pest is on GET /o/{org}/sessions/{id}.

## Run it on every Laravel major release

After Laravel publishes a new major, enqueue one session per application repository still on Laravel 11 with this prompt. Prefer serial upgrades on a single monolith; use parallel sessions only across separate apps.

Webhook run.completed payloads should create a review checklist from the decisions section of the PR description so humans finish what the agent refused to guess.

## Why run it on Rush?

A two-major Laravel jump touches Composer, config, Livewire/Filament peers and a MySQL-backed Pest suite. The sandbox can install PHP dependencies, run migrations against a test database and keep every Pest invocation’s output without risking a developer’s local Herd site.

Listing human decisions instead of inventing product choices is what makes the PR reviewable. Parallel apps can move independently with separate proof.

## Frequently asked questions

### Does it jump straight to Laravel 13 in one composer require?

No. It follows the official guides step by step, typically 11 → 12 → 13, running Pest after each step so failures stay attributable.

### How are tests run?

With vendor/bin/pest -p as the README documents, against the testing database configured in phpunit.xml. The agent reports when MySQL or optional Scout services block a subset of tests.

### Will it upgrade Filament and Livewire automatically?

Only as far as the Laravel upgrade and the test suite require. Broader admin-stack majors that need product choices are listed under human decisions.

### Is Valet or Herd required in the sandbox?

No. The agent uses artisan, Composer and Pest directly. Herd/Valet links from the README are local developer convenience, not a sandbox requirement.
