PHPackages                             calebdw/larastan - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. calebdw/larastan

ActivePhpstan-extension[Testing &amp; Quality](/categories/testing)

calebdw/larastan
================

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

v3.11.0(1mo ago)15118.7k↓10.7%1[4 issues](https://github.com/calebdw/larastan/issues)2MITPHPPHP ^8.2CI passing

Since Mar 8Pushed 4w ago3 watchersCompare

[ Source](https://github.com/calebdw/larastan)[ Packagist](https://packagist.org/packages/calebdw/larastan)[ Docs](https://github.com/calebdw/larastan)[ GitHub Sponsors](https://github.com/calebdw)[ RSS](/packages/calebdw-larastan/feed)WikiDiscussions 3.x Synced 3d ago

READMEChangelog (10)Dependencies (68)Versions (73)Used By (2)

 [![Larastan Logo](https://raw.githubusercontent.com/calebdw/larastan/master/docs/logo.png)](https://raw.githubusercontent.com/calebdw/larastan/master/docs/logo.png)

 [![Larastan Example](https://raw.githubusercontent.com/calebdw/larastan/master/docs/example.png)](https://raw.githubusercontent.com/calebdw/larastan/master/docs/example.png)

 [![Laravel Compatibility](https://camo.githubusercontent.com/b328d7283de82c8038c2635c46da03fe7d2ab6b37c7393764456b9d7bc1ba70a/68747470733a2f2f62616467652e6c61726176656c2e636c6f75642f62616467652f63616c656264772f6c6172617374616e)](https://packagist.org/packages/calebdw/larastan) [![Test Results](https://github.com/calebdw/larastan/actions/workflows/tests.yml/badge.svg)](https://github.com/calebdw/larastan/actions) [![Total Downloads](https://camo.githubusercontent.com/edfd1f6c5110e2cb21d432fec412f11620bb98855d6ac1146e17a3249a2bd4ee/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f63616c656264772f6c6172617374616e2e737667)](https://packagist.org/packages/calebdw/larastan) [![Latest Version](https://camo.githubusercontent.com/a65352d753c63802fe84c76aa3811fbb36c78056dc8bef99ab42ca78aa3deaf8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f63616c656264772f6c6172617374616e2e737667)](https://packagist.org/packages/calebdw/larastan) [![License](https://camo.githubusercontent.com/c9242177567dd01ab070db8ac8908e3781851552652f1a18f66f7f190887bd68/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f63616c656264772f6c6172617374616e)](https://github.com/calebdw/larastan/blob/master/LICENSE.md)

---

⚗️ About This Fork
------------------

[](#️-about-this-fork)

Hello! 👋

This is my fork of [larastan/larastan](https://github.com/larastan/larastan), which includes additional features and improvements that have been proposed but are not yet available in the upstream package. This fork is intended to provide the community with immediate access to these enhancements while maintaining compatibility with the upstream package.

Tip

For [Laravel Livewire](https://github.com/livewire/livewire) support, check out [larastan-livewire](https://github.com/calebdw/larastan-livewire)!

🔄 Changes and Upstream PRs
--------------------------

[](#-changes-and-upstream-prs)

This fork includes the following changes and enhancements:

- [fix: mark macro methods as static only if the closure is static](https://github.com/larastan/larastan/pull/2398)
- [feat: add support for Collection, Builder, and Arr pluck](https://github.com/larastan/larastan/pull/2346)
- [fix: self::query() for final models](https://github.com/larastan/larastan/pull/2338)
- [feat: add optional noModelForwardingToBuilder and noModelStaticForwardingToBuilder](https://github.com/larastan/larastan/pull/2317)
- [fix: factory {has,for}\* methods should return static](https://github.com/larastan/larastan/pull/2252)
- [fix: property type for uuid and ulid primary keys](https://github.com/larastan/larastan/pull/2197)
- [fix: collection template types being overwritten](https://github.com/larastan/larastan/pull/2249)
- [fix: builder stubs and builder/model forwarding](https://github.com/larastan/larastan/pull/2180)
- [fix: handle collection intersection types](https://github.com/larastan/larastan/pull/2058)
- [feat: support dynamic relation closures](https://github.com/larastan/larastan/pull/2048)
- [feat: add support for config array shapes](https://github.com/larastan/larastan/pull/2004)
- [feat: support multiple database connections](https://github.com/larastan/larastan/pull/1879)
- [feat: support wildcards in migration/schema paths](https://github.com/larastan/larastan/pull/2031)
- [fix: default date casting](https://github.com/larastan/larastan/pull/1842)
- [fix: make TGet covariant on Attribute stub](https://github.com/larastan/larastan/pull/2014)

✨ Getting Started
-----------------

[](#-getting-started)

To use this fork, you may use [Composer](https://getcomposer.org) to install it as a development dependency into your Laravel project:

```
composer require --dev "calebdw/larastan:^3.0"
```

Or if you already have the upstream package installed, you can point your `composer.json` to this fork:

```
- "larastan/larastan": "^3.0"
+ "calebdw/larastan": "^3.0"
```

If you have the [PHPStan extension installer](https://phpstan.org/user-guide/extension-library#installing-extensions) installed then nothing more is needed, otherwise you will need to manually include the extension in the `phpstan.neon(.dist)` configuration file:

```
includes:
    - ./vendor/calebdw/larastan/extension.neon
```

For more information on how to configure and use Larastan, please refer to the [official documentation](https://github.com/larastan/larastan).

👊🏻 Contributing
---------------

[](#-contributing)

Thank you for considering contributing to Larastan. All the contribution guidelines are mentioned [here](CONTRIBUTING.md).

📄 License
---------

[](#-license)

This fork is open-sourced software licensed under the [MIT license](LICENSE.md).

###  Health Score

59

—

FairBetter than 98% of packages

Maintenance88

Actively maintained with recent releases

Popularity41

Moderate usage in the ecosystem

Community28

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~13 days

Recently: every ~7 days

Total

53

Last Release

28d ago

Major Versions

v2.10.11 → v3.1.02025-01-26

2.x-dev → v3.1.42025-02-07

PHP version history (2 changes)v2.10.0PHP ^8.0.2

v3.1.0PHP ^8.2

### Community

Maintainers

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

---

Top Contributors

[![canvural](https://avatars.githubusercontent.com/u/1574232?v=4)](https://github.com/canvural "canvural (673 commits)")[![nunomaduro](https://avatars.githubusercontent.com/u/5457236?v=4)](https://github.com/nunomaduro "nunomaduro (453 commits)")[![szepeviktor](https://avatars.githubusercontent.com/u/952007?v=4)](https://github.com/szepeviktor "szepeviktor (182 commits)")[![calebdw](https://avatars.githubusercontent.com/u/4176520?v=4)](https://github.com/calebdw "calebdw (178 commits)")[![Daanra](https://avatars.githubusercontent.com/u/6588838?v=4)](https://github.com/Daanra "Daanra (35 commits)")[![ondrejmirtes](https://avatars.githubusercontent.com/u/104888?v=4)](https://github.com/ondrejmirtes "ondrejmirtes (24 commits)")[![spawnia](https://avatars.githubusercontent.com/u/12158000?v=4)](https://github.com/spawnia "spawnia (23 commits)")[![mad-briller](https://avatars.githubusercontent.com/u/28307684?v=4)](https://github.com/mad-briller "mad-briller (17 commits)")[![CyberiaResurrection](https://avatars.githubusercontent.com/u/9083866?v=4)](https://github.com/CyberiaResurrection "CyberiaResurrection (14 commits)")[![kylekatarnls](https://avatars.githubusercontent.com/u/5966783?v=4)](https://github.com/kylekatarnls "kylekatarnls (12 commits)")[![ramonrietdijk](https://avatars.githubusercontent.com/u/85165272?v=4)](https://github.com/ramonrietdijk "ramonrietdijk (12 commits)")[![mvdnbrk](https://avatars.githubusercontent.com/u/802681?v=4)](https://github.com/mvdnbrk "mvdnbrk (11 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (9 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (8 commits)")[![erikgaal](https://avatars.githubusercontent.com/u/1234268?v=4)](https://github.com/erikgaal "erikgaal (8 commits)")[![johanvanhelden](https://avatars.githubusercontent.com/u/19389981?v=4)](https://github.com/johanvanhelden "johanvanhelden (8 commits)")[![0xb4lint](https://avatars.githubusercontent.com/u/3747631?v=4)](https://github.com/0xb4lint "0xb4lint (7 commits)")[![BertvanHoekelen](https://avatars.githubusercontent.com/u/7521173?v=4)](https://github.com/BertvanHoekelen "BertvanHoekelen (7 commits)")[![crissi](https://avatars.githubusercontent.com/u/3076578?v=4)](https://github.com/crissi "crissi (7 commits)")[![mr-feek](https://avatars.githubusercontent.com/u/5747667?v=4)](https://github.com/mr-feek "mr-feek (7 commits)")

---

Tags

code-analysislarastanlaravelphpstanphpstan-extensionstatic-analysisphpPHPStanlaravelstatic analysispackagecode analysiscode analyselarastan

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[larastan/larastan

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

6.5k55.4M8.5k](/packages/larastan-larastan)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M199](/packages/laravel-ai)[illuminate/queue

The Illuminate Queue package.

21332.6M1.6k](/packages/illuminate-queue)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77022.3M151](/packages/laravel-mcp)[api-platform/laravel

API Platform support for Laravel

58171.6k14](/packages/api-platform-laravel)

PHPackages © 2026

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