Laravel code-quality tools

This page summarizes the projects mentioned and recommended in the original post on dev.to

InfluxDB – Built for High-Performance Time Series Workloads
InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  1. food-order-app-laravel-tdd

    A sample project for demonstrating the basics of test-driven development in Laravel

    git clone https://github.com/anchetaWern/food-order-app-laravel-tdd cd food-order-app-laravel-tdd git checkout tdd

  2. InfluxDB

    InfluxDB – Built for High-Performance Time Series Workloads. InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.

    InfluxDB logo
  3. PHP-CS-Fixer

    Discontinued A tool to automatically fix PHP Coding Standards issues [Moved to: https://github.com/PHP-CS-Fixer/PHP-CS-Fixer] (by FriendsOfPHP)

    If you don't want to use any of those presets, your only option is to specify the all the rules by hand. Pint is built on top of PHP CS Fixer so you can use all the rules that it has. You can use the PHP-CS-Fixer configurator to cherry-pick your own set of rules.

  4. enlightn

    Your performance & security consultant, an artisan command away.

    Enlightn scans your code to check whether it follows best practices in performance, security, and reliability. It's a paid tool, but it also has free checks you can use. At the time of writing, it has 64 checks in the free version and 128 checks in the paid version. For the purposes of this article, we'll only be using the free version.

  5. PHP Code Sniffer

    PHP_CodeSniffer tokenizes PHP files and detects violations of a defined set of coding standards.

    PHP Insights supports sniffs from PHP CodeSniffer and fixers from PHP CS Fixer. This allows you to add any sniff or fixer as long as it implements PHP_CodeSniffer\Sniffs\Sniff or PhpCsFixer\Fixer\FixerInterface.

  6. Psalm

    A PHP static analysis tool for finding errors and security vulnerabilities in PHP applications

    Psalm is a static analysis tool for PHP. Much like PHPStan is to Larastan, Psalm has a plugin called Laravel Psalm that allows you to easily use it in Laravel projects.

  7. coding-standard

    Slevomat Coding Standard for PHP_CodeSniffer provides many useful sniffs

    If you go through the imports in the config/insights.php file, you'll see that it mostly uses rules from NunoMaduro\PhpInsights and SlevomatCodingStandard\Sniffs. The former is PHP Insight's in-house insights and the latter is the sniffs from the Slevomat coding standard. In most cases, you'll only ever reach for those two.

  8. PHPStan

    PHP Static Analysis Tool - discover bugs in your code without running it!

    PHPStan is a static analysis tool for PHP. Larastan is a package built on top of PHPStan to make it easier to integrate with Laravel projects. PHPStan works by "sniffing" the code using the various rulesets applied to it and determine if it follows the standards. However, Larastan doesn't fully follow the definition of "static analysis" since it has to boot the application's container and resolve the types that can only be computed at runtime. This is why Larastan is called a "code analysis" tool rather than a "static analysis" tool.

  9. SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  10. larastan

    Discontinued ⚗️ Adds code analysis to Laravel improving developer productivity and code quality. [Moved to: https://github.com/larastan/larastan] (by nunomaduro)

    In addition to the checks that PHPStan provides, Larastan has checks specific to Laravel. You can check out the rules doc for that.

  11. psalm-plugin-laravel

    A Psalm plugin for Laravel

    Psalm is a static analysis tool for PHP. Much like PHPStan is to Larastan, Psalm has a plugin called Laravel Psalm that allows you to easily use it in Laravel projects.

  12. phpinsights

    🔰 Instant PHP quality checks from your console

    PHP Insights is a code quality analysis tool that checks for code quality, coding style, complexity, and architecture. Just like Pint, it's also opinionated, so you'll have to customize it to fit your needs.

  13. ale

    Check syntax in Vim/Neovim asynchronously and fix files, with Language Server Protocol (LSP) support

    Support for code quality tools are provided by the ALE plugin. These are supported for PHP:

  14. sublime-phpcs

    🔍 PHP CodeSniffer, PHP Coding Standard Fixer, Linter, and Mess Detector Support for Sublime Text

    Sublime-phpcs - adds support for PHP_CodeSniffer, PHP Code Beautifier, PHP CS Fixer, PHP Linter, and PHP Mess Detector.

  15. starter-workflows

    Accelerating new GitHub Actions workflows

    The real power of using PHP code-quality tools is when it’s added to your continuous integration process, which means it automatically checks the code every time someone makes a push or pull request to your project repo. In this section, we'll be looking at how to do just that. GitHub actions is available for free so we'll use it for demo purposes. Note that there are some limits to private repos, so set your test repo to public if you can.

  16. LSP

    Client implementation of the Language Server Protocol for Sublime Text

    Psalm - support for Psalm can be added via the LSP plugin. More information about it can be found in Psalm's documentation.

  17. laravel-pint-action

    GitHub Action for Laravel Pint

    Here's the workflow for Laravel Pint. In this case, we're using a ready-made action. Since Laravel Pint is so simple, we can get away with using something like this. Instead of run, you supply the name of the action. You can find these on GitHub Marketplace or simply search for "[name of code quality tool] github action" on Google:

  18. In the above workflow, we used the --report option and that requires us to have the ENLIGHTN_USERNAME and ENLIGHTN_API_TOKEN in our environment variables. Since we can't directly add them to our .env file for security reasons, we need to use Actions Secrets. You can add secrets on this page: https://github.com/yourGitHubUsername/yourRepoName/settings/secrets/actions. Click on the New repository secret button to add your secret:

  19. SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • PHP: errors to avoid with constructors

    2 projects | dev.to | 4 Mar 2025
  • Build a Symfony 7 boilerplate using FrankenPHP, Docker, PostgreSQL and php 8.4

    11 projects | dev.to | 23 Dec 2024
  • Showcasing PHP-Parser: A Native PHP Parser Written in PHP

    1 project | news.ycombinator.com | 29 Sep 2024
  • PHP Is the Best Choice for Long‑Term Business

    1 project | news.ycombinator.com | 3 Sep 2024
  • PHP-Parser: A Native PHP Parser for Parsing and Analyzing PHP Code

    3 projects | news.ycombinator.com | 24 Aug 2024

Did you know that PHP is
the 14th most popular programming language
based on number of references?