Ensuring Laravel Code Styles

In 42mate we are very strict to follow the coding standards of the products that we use, so for example Drupal has a coding standard, Laravel uses the PSR standards, since we work in different kind of projects sometimes we get confused about the CS of the projects and we need something to help us to ensure the coding styles.

In Drupal projects we use the Coder module that will check the sources for style errors, however, for Laravel projects we use Code Sniffer, this is a lint tool for PHP projects.

To install Code Sniffer you can use composer and install it globally

composer global require "squizlabs/php_codesniffer=*"

Once is installed, from the root of your laravel project you can run this command to check your styles