Shift with red gradient lettering

Configuring Shift

Configure Shifts behavior by adding a .shiftrc file.

Watch Next

Customizing the code style

Configure Shift to apply your own custom code style.

Gaining confidence with tests

Pair Shift with tests for the most automation.

Transcript

Shift now allows you to customize aspects of its automation process.

This has been a long requested feature. However, until recently there haven't been enough options available.

Now with the Laravel Linter, the Laravel Fixer, and the new subscription services there are additional customizations.

While more configuration options are being added, I will demonstrate setting up a custom configuration for your projects and some of the current options.

Much like other services and tools, Shift now looks with in your project root directory for a .shiftrc.

This file is in INI format. Much like the PHP configuration file. And, similar to the Laravel configuration files, the documentation for each option is embedded within the comments.

You can get a copy of the latest version of this file from the documentation page or the gist on GitHub.

All available options are sent to their default value. So you may simply add the file to your project and customize only the options you wish to tweak

The configuration is broken into three main sections. At the highest level there are configuration options for all Shifts, next options specific to a language, for example PHP, and at the lowest level options specific for to certain Shifts, for example the Laravel Shifts.

Let's take a look at a few of the current options.

One of the most requested option deals with code formatting. While Shift has always applied the same coding style of Laravel, some users prefer their own code style.

Now you may adjust this by specifying a path to your .php_cs file. This will configure PHP CS Fixer to apply your customized code style during your Shift.

Other options allow you to specify directories to exclude or exclude during the Shift process. While Shift recommends using the default project structure, this is helpful if you have additional files which should be included during the Shift process.

There are also additional options specific to each Shift. For example, there are several options which allow you to toggle on and off checks performed by the Laravel Linter and automated with the Laravel Fixer. These include disabling the Resourceful Controller or Inline Validation checks, as well as customizing how requests are referenced.

While Shift is designed to follow language, framework, and community recommendations, the .shiftrc file gives you the flexibility to customize the automation performed by Shift.

Sign in with any of the following services to connect Shift with your Laravel project.


Don't use one of these services?

Temporarily push your project to a free, private repository on one of these cloud-based services or upgrade your project locally with Shift for Docker.