New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

calebdw/phpstan-laravel

A PHPStan extension for analysis of Laravel applications and packages.
38,319 38

Larablocks Analysis

calebdw/phpstan-laravel works with Laravel 12 and 13 (latest release v1.12.1, Nov 17, 2026).

Recommendation checks

Solid choice

Solid 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
Maintainer: calebdw

phpstan-laravel

Teaches PHPStan about Laravel's magic

Latest Version Laravel Compatibility PHP Compatibility Laravel Boost Total Downloads Tests License

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/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan exte...

100,439,351 6,560
shipmonk/dead-code-detector

Dead code detector to find unused PHP code via PHPStan extension. Can automatica...

8,468,318 539
tomasvotruba/bladestan

PHPStan rule for static analysis of Blade templates

1,144,260 373
script-development/phpstan-warroom-rules

Canonical PHPStan rules enforcing war-room doctrine across script-development La...

38,881 0

Version History

Version Released PHP Laravel License
v1.12.1 ^8.3 ^12.67.0 || ^13.38.0 MIT
v1.12.0 ^8.3 ^12.67.0 || ^13.38.0 MIT
v1.11.1 ^8.3 ^12.67.0 || ^13.38.0 MIT
v1.11.0 ^8.3 ^12.67.0 || ^13.38.0 MIT
v1.10.0 ^8.3 ^12.67.0 || ^13.26.1 MIT