calebdw/phpstan-laravel
Larablocks Analysis
calebdw/phpstan-laravel works with Laravel 12 and 13 (latest release v1.12.1, Nov 17, 2026).
Recommendation checks
Solid choiceSolid choice: maintained and up to date, meets 3 of 4 checks; below the bar for Recommended on use.
- Works with Laravel 13, the current version
- Released in the last 12 months (Nov 17, 2026)
- 21,366 downloads a month (at least 10,000)
- 38 GitHub stars (needs 100)
State
Actively maintained- Last stable release: Nov 17, 2026.
- 22 releases in the last 12 months.
- First released: Aug 24, 2026.
- Monthly downloads: 21,366.
- 0 open issues on GitHub.
Data from Packagist and GitHub, checked by Larablocks on Nov 29, 2026.
| Install | |
|---|---|
composer require calebdw/phpstan-laravel |
|
| Latest Version: | v1.12.1 |
| PHP: | ^8.3 |
| Laravel: | 12 · 13 |
| License: | MIT |
| Last Updated: | Nov 29, 2026 |
| Links: | GitHub · Packagist |
Teaches PHPStan about Laravel's magic
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 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<int, App\Account>
User::query()->pluck('name'); // Collection<int, string>
$user->accounts()->pluck('name'); // Collection<int, string>
User::all()->groupBy('email'); // Collection<string, Collection<int, App\User>>
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.
Documentation
To get started, take a look at the official documentation: installation, configuration, every rule, every option and identifier, and the guide for moving over from Larastan.
Contributing
Contributions are welcome: see CONTRIBUTING.md.
Acknowledgments
This package began as a fork of larastan/larastan, created by Can Vural and Nuno Maduro and improved by many contributors over the years. It would not exist without their work.
License
Open-sourced software licensed under the MIT license.
Alternatives to calebdw/phpstan-laravel
Larastan - Discover bugs in your code without running it. A phpstan/phpstan exte...
Dead code detector to find unused PHP code via PHPStan extension. Can automatica...
Canonical PHPStan rules enforcing war-room doctrine across script-development La...
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| v1.12.1 | ^8.3 | ^12.67.0 || | MIT | |
| v1.12.0 | ^8.3 | ^12.67.0 || | MIT | |
| v1.11.1 | ^8.3 | ^12.67.0 || | MIT | |
| v1.11.0 | ^8.3 | ^12.67.0 || | MIT | |
| v1.10.0 | ^8.3 | ^12.67.0 || | MIT | |
| v1.9.5 | ^8.3 | ^12.67.0 || | MIT | |
| v1.9.4 | ^8.3 | ^12.67.0 || | MIT | |
| v1.9.3 | ^8.3 | ^12.67.0 || | MIT | |
| v1.9.2 | ^8.3 | ^12.67.0 || | MIT | |
| v1.9.1 | ^8.3 | ^12.67.0 || | MIT | |
| v1.9.0 | ^8.3 | ^12.67.0 || | MIT | |
| v1.8.0 | ^8.3 | ^12.67.0 || | MIT | |
| v1.7.0 | ^8.3 | ^12.67.0 || | MIT | |
| v1.6.0 | ^8.3 | ^12.67.0 || | MIT | |
| v1.5.0 | ^8.3 | ^12.67.0 || | MIT | |
| v1.4.0 | ^8.3 | ^12.67.0 || | MIT | |
| v1.3.1 | ^8.3 | ^12.67.0 || | MIT | |
| v1.3.0 | ^8.3 | ^12.67.0 || | MIT | |
| v1.2.0 | ^8.3 | ^12.67.0 || | MIT | |
| v1.1.0 | ^8.3 | ^12.67.0 || | MIT | |
| v1.0.1 | ^8.3 | ^12.67.0 || | MIT | |
| v1.0.0 | ^8.3 | ^12.67.0 || | MIT |