PHPackages                             magdy-hakam/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. magdy-hakam/larastan

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

magdy-hakam/larastan
====================

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

v0.5.8(3y ago)05MITPHPPHP ^7.2||^8.0

Since Apr 3Pushed 3y ago1 watchersCompare

[ Source](https://github.com/magdyHakam/larastan)[ Packagist](https://packagist.org/packages/magdy-hakam/larastan)[ RSS](/packages/magdy-hakam-larastan/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (13)Versions (2)Used By (0)

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

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

 [![Build Status](https://camo.githubusercontent.com/d367afb3179deb140fd2862867df1e524dba58c68a48927bd86cb4c05637f93c/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6e756e6f6d616475726f2f6c6172617374616e2f6d61737465722e737667)](https://travis-ci.org/nunomaduro/larastan) [![Total Downloads](https://camo.githubusercontent.com/765f9c588792699eec63d6138ba491c44f74fd326a8d90aa7a52bd6707ed5b17/68747470733a2f2f706f7365722e707567782e6f72672f6e756e6f6d616475726f2f6c6172617374616e2f642f746f74616c2e737667)](https://packagist.org/packages/nunomaduro/larastan/stats) [![Latest Version](https://camo.githubusercontent.com/2497657ae2f10a3a02e010f5bf6f39586b6f047b1ae9a8c256ef4fb120549c61/68747470733a2f2f706f7365722e707567782e6f72672f6e756e6f6d616475726f2f6c6172617374616e2f762f737461626c652e737667)](https://packagist.org/packages/nunomaduro/larastan) [![License](https://camo.githubusercontent.com/7bda7d876bde078db8ea134bfcc438f62b6a392e9cf65f58c19188e2046cb5c5/68747470733a2f2f706f7365722e707567782e6f72672f6e756e6f6d616475726f2f6c6172617374616e2f6c6963656e73652e737667)](https://packagist.org/packages/nunomaduro/larastan)

---

⚗️ About Larastan
-----------------

[](#️-about-larastan)

Larastan was created by [Nuno Maduro](https://github.com/nunomaduro), got artwork designed by [@Caneco](http://github.com/caneco), is maintained by [Can Vural](https://github.com/canvural) and [Viktor Szépe](https://github.com/szepeviktor), and is a [PHPStan](https://phpstan.org/) wrapper for Laravel. Larastan focuses on **finding errors in your code** without actually running it. It catches whole classes of bugs even **before you write tests** for the code.

- Adds static typing to Laravel to improve developer productivity and **code quality**
- Supports most of [Laravel](https://laravel.com)'s **beautiful magic**
- Discovers bugs in your code without running it

✨ Getting Started in 3 Steps
----------------------------

[](#-getting-started-in-3-steps)

> **Requires:**

- **[PHP 7.2+](https://php.net/releases/)**
- **[Laravel 6.0+](https://github.com/laravel/laravel)**

**1**: First, you may use [Composer](https://getcomposer.org) to install Larastan as a development dependency into your Laravel project:

```
composer require --dev nunomaduro/larastan
```

> Using Larastan for analysing Laravel packages? You may need to install `orchestra/testbench`.

**2**: Then, create a `phpstan.neon` or `phpstan.neon.dist` file in the root of your application. It might look like this:

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

parameters:

    paths:
        - app

    # The level 8 is the highest level
    level: 5

    ignoreErrors:
        - '#Unsafe usage of new static#'

    excludes_analyse:
        - ./*/*/FileToBeExcluded.php

    checkMissingIterableValueType: false

```

For all available options, please take a look at the PHPStan documentation: ****

**3**: Finally, you may start analyzing your code using the phpstan console command:

```
./vendor/bin/phpstan analyse
```

If you are getting the error `Allowed memory size exhausted`, then you can use the `--memory-limit` option fix the problem:

```
./vendor/bin/phpstan analyse --memory-limit=2G
```

Rules
-----

[](#rules)

A list of configurable rules specific to Laravel can be found [here](docs/rules.md).

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

[](#-contributing)

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

You can have a look at the [CHANGELOG](CHANGELOG.md) for constant updates &amp; detailed information about the changes. You can also follow the Twitter account for the latest announcements or just come say hi!: [@enunomaduro](https://twitter.com/enunomaduro).

❤️ Support the development
--------------------------

[](#️-support-the-development)

**Do you like this project? Support it by donating**

- PayPal: [Donate](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=66BYDWAT92N6L)
- Patreon: [Donate](https://www.patreon.com/nunomaduro)

📖 License
---------

[](#-license)

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

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity39

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

1135d ago

### Community

Maintainers

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

---

Top Contributors

[![magdyHakam](https://avatars.githubusercontent.com/u/15979831?v=4)](https://github.com/magdyHakam "magdyHakam (2 commits)")

---

Tags

phpPHPStanlaravelstatic analysispackagecode analysiscode analyselarastan

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[larastan/larastan

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

6.4k43.5M5.2k](/packages/larastan-larastan)[calebdw/larastan

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

1484.6k3](/packages/calebdw-larastan)[aedart/athenaeum

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

255.2k](/packages/aedart-athenaeum)[laravel/passport

Laravel Passport provides OAuth2 server support to Laravel.

3.4k85.0M532](/packages/laravel-passport)[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k25.9M107](/packages/laravel-cashier)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)

PHPackages © 2026

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