PHPackages                             calebdw/phpstan-laravel - 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. calebdw/phpstan-laravel

ActivePhpstan-extension

calebdw/phpstan-laravel
=======================

A PHPStan extension for analysis of Laravel applications and packages.

v1.2.0(today)516↑2712.5%1[2 issues](https://github.com/calebdw/phpstan-laravel/issues)MITPHPPHP ^8.3CI passing

Since Aug 24Pushed today1 watchersCompare

[ Source](https://github.com/calebdw/phpstan-laravel)[ Packagist](https://packagist.org/packages/calebdw/phpstan-laravel)[ Docs](https://phpstan-laravel.dev)[ GitHub Sponsors](https://github.com/calebdw)[ RSS](/packages/calebdw-phpstan-laravel/feed)WikiDiscussions master Synced today

READMEChangelog (5)Dependencies (19)Versions (5)Used By (0)

 [![phpstan-laravel](art/phpstan-laravel.webp)](art/phpstan-laravel.webp)

 **Teaches PHPStan about Laravel's magic**

 [![Latest Version](https://camo.githubusercontent.com/3d28fe1ac0a29e2c854d56ec5d8c2aa510080073890f408c56b9af4487a4a99c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f63616c656264772f7068707374616e2d6c61726176656c2e737667)](https://packagist.org/packages/calebdw/phpstan-laravel) [![Laravel Compatibility](https://camo.githubusercontent.com/77e4aee57ee078d113a18a02b42ec9df19183c403f5aa143595430761d99223a/68747470733a2f2f62616467652e6c61726176656c2e636c6f75642f62616467652f63616c656264772f7068707374616e2d6c61726176656c)](https://packagist.org/packages/calebdw/phpstan-laravel) [![PHP Compatibility](https://camo.githubusercontent.com/843bb2e57057fc1c9b56f35044b88ad605050d94976b0ab8536efe7d11966127/68747470733a2f2f62616467652e6c61726176656c2e636c6f75642f7068702d62616467652f63616c656264772f7068707374616e2d6c61726176656c)](https://packagist.org/packages/calebdw/phpstan-laravel) [![Laravel Boost](https://camo.githubusercontent.com/9bdec9dbce27067f5c86de8d8442d0e3509913eee7ed50033ce9f29912091f48/68747470733a2f2f62616467652e6c61726176656c2e636c6f75642f626f6f73742d62616467652e737667)](https://github.com/laravel/boost) [![Total Downloads](https://camo.githubusercontent.com/3b23f468868926e4bce1a14d9a2799b94748aa75e9bfa36307e28a779bdfc0da/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f63616c656264772f7068707374616e2d6c61726176656c2e737667)](https://packagist.org/packages/calebdw/phpstan-laravel) [![Tests](https://github.com/calebdw/phpstan-laravel/actions/workflows/tests.yml/badge.svg)](https://github.com/calebdw/phpstan-laravel/actions/workflows/tests.yml) [![License](https://camo.githubusercontent.com/428f592d4575fc4c704e5dfa4c0ea6e6a9283e2f163ce9e67125d4f260ffc0dc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f63616c656264772f7068707374616e2d6c61726176656c)](LICENSE)

 [**phpstan-laravel.dev**](https://phpstan-laravel.dev)

Laravel leans on magic: facades, container bindings, dynamic Eloquent properties, method forwarding, macros. A static analyser sees almost none of it on its own, so the parts of your application that carry the most behaviour are the parts it checks least.

This [PHPStan](https://phpstan.org) extension closes that gap. It boots your application during analysis and combines that with stubs, reflection extensions and schema scanning, so PHPStan can reason about your models, relations, collections, configuration and views.

```
$user = User::query()->firstOrFail();   // App\User

$user->email;                           // string
$user->emial;                           // Access to an undefined property
$user->accounts;                        // App\AccountCollection

User::query()->pluck('name');           // Collection
$user->accounts()->pluck('name');       // Collection
User::all()->groupBy('email');          // Collection

config('auth.defaults.guard');          // string|null
Config::string('auth.defaults.guard');  // string

User::create(['emial' => '...']);       // Property 'emial' does not exist
```

None of it comes from annotations you write, and it ships rules for the mistakes Laravel will happily let you make at runtime. It works at every PHPStan level, on applications and on packages.

Everything else is at **[phpstan-laravel.dev](https://phpstan-laravel.dev)**: installation, configuration, every rule, every option and identifier, and the guide for moving over from Larastan.

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

[](#contributing)

Contributions are welcome: see [CONTRIBUTING.md](CONTRIBUTING.md) to get started.

Acknowledgments
---------------

[](#acknowledgments)

This package began as a fork of [larastan/larastan](https://github.com/larastan/larastan), created by [Can Vural](https://github.com/canvural) and [Nuno Maduro](https://github.com/nunomaduro) and improved by many contributors over the years. It would not exist without their work.

License
-------

[](#license)

Open-sourced software licensed under the [MIT license](LICENSE).

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance92

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 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

Every ~0 days

Total

4

Last Release

0d ago

### Community

Maintainers

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

---

Top Contributors

[![calebdw](https://avatars.githubusercontent.com/u/4176520?v=4)](https://github.com/calebdw "calebdw (65 commits)")

---

Tags

code-analysislaravelphpstanphpstan-extensionstatic-analysisphpPHPStanlaravelstatic analysispackagephpstan-extensioncode analysis

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/calebdw-phpstan-laravel/health.svg)

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

###  Alternatives

[larastan/larastan

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

6.5k60.6M10.7k](/packages/larastan-larastan)[calebdw/larastan

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

16132.2k4](/packages/calebdw-larastan)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.4M354](/packages/psalm-plugin-laravel)[illuminate/queue

The Illuminate Queue package.

20433.0M1.8k](/packages/illuminate-queue)[laravel/ai

The official AI SDK for Laravel.

1.1k4.6M337](/packages/laravel-ai)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

265.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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