Introducing Larastan — Alpha

I just released the Alpha version of Larastan! Here is a presentation on how it works, the upcoming developments and improvements

Nuno Maduro
Jul 17, 2018 · 2 min read
Image for post
Image for post

The package is still under development and feedback is highly welcome. Please don’t ignore false positives, and report them using the issues tab of this project. 🙏

Check package’s github page here! 📦

General details

Larastan was created by, and is maintained by Nuno Maduro, and is a 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. The first alpha version supports most of Laravel's beautiful magic.

Installation & Usage

You may use Composer to install Larastan as a development dependency into your Laravel project:

composer require --dev nunomaduro/larastan

Once you have installed Larastan, you may start analyzing your code using the code:analyse artisan command.

php artisan code:analyse

Rule levels

You can choose from currently 8 levels: (0 is the loosest and 7 is the strictest). The default level is “5”. You can also use the level “max” as an alias for the highest level.

php artisan code:analyse --level=max


You can choose which directories you want to analyze, by default, the analysed directory will be the “app”.

php artisan code:analyse --paths="modules,app,domain"

Upcoming developments and improvements

Get involved

This is a community project, there are many opportunities to contribute to all the Larastan ecosystem.

Feel free to contact me on twitter: @enunomaduro.

Thanks, I hope you enjoy this new release! 🎉

If you found this article useful, please comment below and clap, if you like.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store