PHPackages                             jaydeep/laravel-preflight - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. jaydeep/laravel-preflight

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

jaydeep/laravel-preflight
=========================

Artisan command that scans your Laravel codebase for breaking changes and compatibility issues before you upgrade to Laravel 9, 10, 11, 12, or 13.

v1.0.0(today)22↑2900%MITPHPPHP ^7.4|^8.0

Since Jun 9Pushed todayCompare

[ Source](https://github.com/JaydeepGadhiya/laravel-preflight)[ Packagist](https://packagist.org/packages/jaydeep/laravel-preflight)[ RSS](/packages/jaydeep-laravel-preflight/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (3)Versions (2)Used By (0)

Laravel Preflight
=================

[](#laravel-preflight)

[![Latest Version](https://camo.githubusercontent.com/0fd35e1b7d25f4e906132799c28667b03c889cab7933ba7c33afc4a4d77a321a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a6179646565702f6c61726176656c2d707265666c69676874)](https://packagist.org/packages/jaydeep/laravel-preflight)[![Total Downloads](https://camo.githubusercontent.com/60ce1682ee0fa7ef3ca8e51b86cf1606203443e41a52b973411f92b2bb64a525/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a6179646565702f6c61726176656c2d707265666c69676874)](https://packagist.org/packages/jaydeep/laravel-preflight)[![PHP](https://camo.githubusercontent.com/ce0c70c519047d0e507604f03e6e8ae6c27bcc072027e899680d9bf93804dc76/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d372e342532422d626c7565)](https://php.net)[![Laravel](https://camo.githubusercontent.com/9818db983d4eda51acff3d47ea7d563800bdcce87aca768b482e74abd92cd9b8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d382d2d31332d726564)](https://laravel.com)[![License](https://camo.githubusercontent.com/5caa455d8debc46fb23abbadb45a733a937f3910a73fc875c2f7820468e1bb54/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e)](LICENSE)

> **The fastest way to find every breaking change before you upgrade Laravel.**

One Artisan command scans your entire codebase and reports only the upgrade issues that **actually exist in your project** — across PHP files, `composer.json`, config files, and `.env`. Supports upgrading from **Laravel 8 through 13** with 70+ checks covering every major breaking change.

---

Why Laravel Preflight?
----------------------

[](#why-laravel-preflight)

The official Laravel upgrade guide lists every possible breaking change — but most of them won't affect your app. Reading through the full guide, manually searching your code, and checking config keys wastes hours.

**This tool does it in seconds:**

- **Zero false positives** — only flags issues found in your actual code
- **Multi-version support** — checking Laravel 8 → 13 covers all 5 intermediate upgrade paths in one run
- **Actionable fixes** — every issue includes the exact fix command or change needed
- **No code modifications** — read-only scan, safe to run any time
- **CI/CD ready** — exits with code `1` when blocking issues exist, `0` when clean

---

Installation
------------

[](#installation)

```
composer require jaydeep/laravel-preflight
```

Auto-discovered. No service provider registration needed.

---

Quick Start
-----------

[](#quick-start)

```
# Scan for breaking changes before upgrading to Laravel 13
php artisan upgrade:check 13

# Scan for a specific target version
php artisan upgrade:check 11

# Generate a full HTML + Markdown report
php artisan upgrade:check 13 --report
```

The command auto-detects your current Laravel version from `composer.json`. Multi-version upgrades are fully supported — scanning from Laravel 8 to 13 covers all intermediate breaking changes in a single run.

---

Screenshots
-----------

[](#screenshots)

### Console Output

[](#console-output)

[![Console output showing upgrade compatibility report](docs/screenshots/console-output.png)](docs/screenshots/console-output.png)

### HTML Report

[](#html-report)

[![HTML report opened in browser](docs/screenshots/html-report.png)](docs/screenshots/html-report.png)

---

How It Works
------------

[](#how-it-works)

**1. Detect** — Reads your `composer.json` to determine the current Laravel version and the target you specify.

**2. Scan** — Runs four analyzers across your codebase:

AnalyzerScansChecks**ComposerAnalyzer**`composer.json`Deprecated, removed, or replaced packages**CodeAnalyzer**`app/`, `routes/`, `config/`, `database/`, `resources/`, `tests/`Regex pattern search across all `.php` files**ConfigAnalyzer**`config/*.php`Missing or renamed config keys**EnvAnalyzer**`.env.example` / `.env`New required environment variables**3. Report** — Prints a grouped, colour-coded console report. Use `--report` to also write `storage/upgrade-report.md` and `storage/upgrade-report.html`.

---

Supported Upgrade Paths
-----------------------

[](#supported-upgrade-paths)

TargetFromKey Breaking Changes Checked**Laravel 9**Laravel 8PHP 8.0 required, SwiftMailer removed, `fruitcake/laravel-cors` deprecated, `facade/ignition` replaced, `$dates` property deprecated, Flysystem 3.x, `dispatch_now()` removed, mail config `default` key**Laravel 10**Laravel 9PHP 8.1 required, `Bus::dispatchNow()` removed, `assertDeleted()` removed, `$dates` fully removed, Predis 2.x required, native return types enforced, `getQueueableRelations()` return type**Laravel 11**Laravel 10PHP 8.2 required, slim skeleton (`Http/Kernel.php` removed, `Console/Kernel.php` removed), service providers consolidated, `routes/api.php` not auto-loaded, `routes/channels.php` not auto-loaded, Carbon 3.x**Laravel 12**Laravel 11`doctrine/dbal` dropped, `Model::reguard()` removed, `Response::json()` throws on invalid JSON, `Collection::groupBy()` key preservation, `whereRelation()` signature, `Str::password()` removed, `spatie/laravel-ignition` ^2.0**Laravel 13**Laravel 12`VerifyCsrfToken` → `PreventRequestForgery`, cache `serializable_classes`, `DB::upsert()` validation, cache key prefix format, polymorphic pivot names, `JobAttempted` event property, `array_first()`/`array_last()` conflicts---

Example Output
--------------

[](#example-output)

```
  Laravel Preflight  by Jaydeep
  ─────────────────────────────────────────

  Current Laravel: v8
  Target  Laravel: v13

  Scanning codebase...

  ┌─────────────────────────────────────────────┐
  │          UPGRADE COMPATIBILITY REPORT        │
  └─────────────────────────────────────────────┘

   CRITICAL  7   WARNING 8   INFO 5   Passed 54

  ── COMPOSER

  [CRITICAL] fruitcake/laravel-cors deprecated
         The fruitcake/laravel-cors package is superseded by Laravel's built-in CORS support.
           → composer.json
         Fix: Remove fruitcake/laravel-cors. Use the built-in config/cors.php.

  ── CODE

  [WARNING] Model $dates property deprecated
         The $dates property on Eloquent models is deprecated in L9, removed in L10.
           → app/Models/Post.php
         Fix: Replace protected $dates = [...] with protected $casts = ['field' => 'datetime'].

  ── MIDDLEWARE

  [CRITICAL] VerifyCsrfToken renamed to PreventRequestForgery
         The CSRF middleware class was renamed and now includes request-origin verification.
           → app/Http/Kernel.php
         Fix: Replace VerifyCsrfToken::class with PreventRequestForgery::class.

  54 check(s) passed (no issues found for those).

  Run with --report to save a full Markdown + HTML report:
  php artisan upgrade:check --report

```

---

Report Files
------------

[](#report-files)

Add `--report` to generate both a Markdown and a self-contained HTML report:

```
php artisan upgrade:check 13 --report
```

FileDescription`storage/upgrade-report.md`Markdown — commit to your repo or share in a PR`storage/upgrade-report.html`Interactive HTML — severity filters, collapsible cards, one-click copy for fix commands, animated readiness score---

Severity Levels
---------------

[](#severity-levels)

LevelMeaning`CRITICAL`Will break your application — must fix before upgrading`WARNING`Likely to cause bugs or unexpected behaviour — review required`INFO`Behavioural change to be aware of — may or may not affect your app---

CI / CD Integration
-------------------

[](#ci--cd-integration)

The command exits with code `1` when any issues are detected, and `0` when the codebase is clean — making it easy to gate deployments or upgrade PRs in any CI pipeline.

```
# GitHub Actions example
- name: Check Laravel upgrade compatibility
  run: php artisan upgrade:check 13
```

```
# Fail a build if not ready to upgrade
php artisan upgrade:check 13 || exit 1
```

---

Extending: Adding a New Laravel Version
---------------------------------------

[](#extending-adding-a-new-laravel-version)

1. Create `src/VersionRegistry/Laravel{N}Upgrade.php` extending `BaseUpgrade`
2. Implement `getBreakingChanges()` returning an array of `BreakingChange` objects
3. Register it in `VersionRegistry::$upgrades` and bump `$latestVersion`

Each breaking change supports four detection strategies:

PropertyDetected ByExample`$searchPattern``CodeAnalyzer` — regex over PHP files`'/VerifyCsrfToken/'``$composerPackage``ComposerAnalyzer` — checks `composer.json``'facade/ignition'``$configKey``ConfigAnalyzer` — checks `config/{file}.php``'cache.serializable_classes'``$envKey``EnvAnalyzer` — checks `.env.example``'CACHE_PREFIX'````
// Example: adding a breaking change
$this->change(
    'VerifyCsrfToken renamed to PreventRequestForgery',    // title
    'The CSRF middleware class was renamed in Laravel 13.', // description
    'critical',                                             // severity
    'middleware',                                           // category
    'Replace VerifyCsrfToken::class with PreventRequestForgery::class.', // fix
    '/VerifyCsrfToken/'                                     // searchPattern
);
```

---

Architecture
------------

[](#architecture)

```
src/
├── UpgradeAssistantServiceProvider.php   Auto-discovered service provider
├── Commands/
│   └── UpgradeCheckCommand.php           php artisan upgrade:check
├── Analyzers/
│   ├── BaseAnalyzer.php
│   ├── ComposerAnalyzer.php              Scans composer.json
│   ├── CodeAnalyzer.php                  Regex scans PHP files
│   ├── ConfigAnalyzer.php                Checks config/ keys
│   └── EnvAnalyzer.php                   Checks .env.example keys
├── Data/
│   └── BreakingChange.php                Value object for a single issue
├── VersionRegistry/
│   ├── VersionRegistry.php               Maps version numbers to upgrade classes
│   ├── BaseUpgrade.php
│   ├── Laravel9Upgrade.php               L8 → L9 breaking changes
│   ├── Laravel10Upgrade.php              L9 → L10 breaking changes
│   ├── Laravel11Upgrade.php              L10 → L11 breaking changes
│   ├── Laravel12Upgrade.php              L11 → L12 breaking changes
│   └── Laravel13Upgrade.php              L12 → L13 breaking changes
└── Report/
    └── ReportGenerator.php               Console + Markdown + HTML report

```

---

Requirements
------------

[](#requirements)

Version**PHP**`^7.4` | `^8.0`**Laravel**`^8.0` through `^13.0`---

FAQ
---

[](#faq)

**Does it modify any files?**No. The scan is entirely read-only. Nothing in your project is changed.

**Can I run it on a project that is already on a newer version?**Yes — the command detects your current version and skips checks that don't apply. If you're already on the target version it exits immediately.

**How is it different from Rector or Laravel Shift?**Rector and Shift *modify* your code. This tool only *reports* — it tells you what needs to change and where, so you can make the changes yourself with full control.

**Can I use it in a pre-upgrade CI check?**Yes. It returns exit code `1` when issues are found. Add it to your CI pipeline to block merges until the codebase is compatible with the target version.

**What if a check fires but doesn't apply to my app?**The results are informational. Review the listed file paths and decide whether the fix applies to your specific usage.

---

Contributing
------------

[](#contributing)

Contributions are welcome — especially new breaking change definitions for existing or future Laravel versions.

1. Fork the repository
2. Add your breaking changes to the relevant `Laravel{N}Upgrade.php` file
3. Test by running `php artisan upgrade:check` against a project that uses the pattern
4. Open a pull request with a brief description of the breaking change and a link to the official Laravel upgrade guide

---

Related Packages
----------------

[](#related-packages)

- [jaydeep/laravel-guarddog](https://github.com/JaydeepGadhiya/laravel-guarddog) — Laravel security scanner
- [jaydeep/laravel-xray](https://github.com/JaydeepGadhiya/laravel-xray) — Architecture visualization and dead code detection

---

License
-------

[](#license)

MIT — [Jaydeep Gadhiya](https://github.com/JaydeepGadhiya)

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance100

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

0d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b9e410b11aa391f9cf6562aac3a4105798ade1f2312912139c1d96bfd28fcd91?d=identicon)[JaydeepGadhiya](/maintainers/JaydeepGadhiya)

---

Top Contributors

[![JaydeepGadhiya](https://avatars.githubusercontent.com/u/86125530?v=4)](https://github.com/JaydeepGadhiya "JaydeepGadhiya (1 commits)")

---

Tags

compatibilitylaravelstatic analysisartisanupgradepreflightphp upgradelaravel upgradelaravel-migrationbreaking changeslaravel-preflightupgrade-assistantupgrade-checkerlaravel-upgrade-toolversion-upgrade

### Embed Badge

![Health badge](/badges/jaydeep-laravel-preflight/health.svg)

```
[![Health](https://phpackages.com/badges/jaydeep-laravel-preflight/health.svg)](https://phpackages.com/packages/jaydeep-laravel-preflight)
```

###  Alternatives

[laravel/ai

The official AI SDK for Laravel.

9782.1M153](/packages/laravel-ai)[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k51.0M7.4k](/packages/larastan-larastan)[erag/laravel-lang-sync-inertia

A powerful Laravel package for syncing and managing language translations across backend and Inertia.js (Vue/React) frontends, offering effortless localization, auto-sync features, and smooth multi-language support for modern Laravel applications.

4721.5k](/packages/erag-laravel-lang-sync-inertia)[zidbih/laravel-deadlock

Make temporary Laravel workarounds expire and fail CI when ignored.

954.0k](/packages/zidbih-laravel-deadlock)[calebdw/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

15104.9k4](/packages/calebdw-larastan)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.2k](/packages/tomshaw-electricgrid)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
