Skip to content
⚗️ Adds static analysis to Laravel improving developer productivity and code quality
PHP Shell
Branch: master
Clone or download

Latest commit

canvural Merge pull request #481 from mr-feek/remove-duplicated-constants
refactor: consolidate duplicated constants
Latest commit 56b0b2c Feb 28, 2020


Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Create FUNDING.yml May 28, 2019
config Apply fixes from StyleCI Nov 10, 2019
docs Added the official logo Jul 19, 2018
src refactor: consolidate duplicated constants Feb 28, 2020
stubs feature: generic resources Feb 21, 2020
tests fix: dont treat whereHas as dynamic where Feb 27, 2020
.editorconfig Adds first version Jun 29, 2018
.gitattributes Syntax highlight for neon Nov 28, 2018
.gitignore chore: ignores phpunit cache file Aug 25, 2019
.scrutinizer.yml Fix Scrutinizer Aug 25, 2019
.styleci.yml Test file permissions Oct 17, 2018
.travis.yml refactor: remove license headers from files Feb 4, 2020 feature: generic resources Feb 21, 2020 Adds first version Jun 29, 2018 Test file permissions Oct 17, 2018 Packagist download bagde should link to statistics Feb 4, 2020 Add missing GitHub release step Jan 24, 2020 feature: generic resources Feb 21, 2020
bootstrap.php Fix path for ApplicationResolver Dec 22, 2019
composer.json Fixed incorrect minimum php version Jan 1, 2020
extension.neon fix: transform ide-helper relationship docblocks into typed collections Feb 27, 2020
phpstan.neon.dist Upgrade to PHPStan 0.12 Dec 13, 2019
phpunit.xml.dist Adds first version Jun 29, 2018

Larastan Logo

Larastan Example

Build Status Total Downloads Latest Version License

⚗️ About Larastan

Larastan was created by Nuno Maduro, got artwork designed by @Caneco, is maintained by Can Vural and Viktor Szépe, and is a phpstan/phpstan 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's beautiful magic
  • Discovers bugs in your code without running it

Getting Started in 3 Steps


1: First, you may use Composer 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:

    - ./vendor/nunomaduro/larastan/extension.neon


        - app

    # The level 8 is the highest level
    level: 5

        - '#Unsafe usage of new static#'

        - ./*/*/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

👊🏻 Contributing

Thank you for considering contributing to Larastan. All the contribution guidelines are mentioned here.

You can have a look at the CHANGELOG for constant updates & detailed information about the changes. You can also follow the Twitter account for the latest announcements or just come say hi!: @enunomaduro.

❤️ Support the development

Do you like this project? Support it by donating

📖 License

Larastan is an open-sourced software licensed under the MIT license.

You can’t perform that action at this time.