Shift with red gradient lettering

Laravel Fixer

The Laravel Fixer scans your Laravel application and makes changes and recommendations to help you follow the Laravel Way.

What is the Laravel Way? Well, it's a collection of practices outlined in the Laravel docs, commonly adopted by the Laravel community, and derived from analytics on over 50,000 Laravel projects.

The goal is to ensure you're crafting your Laravel application to take full advantage of Laravel's features while maintaining an application that's easy to upgrade.

Screenshot of a pull request with automated changes from the Laravel Fixer

Watch a demo

Requirements

  • A Laravel application running Laravel 10.0 or higher.
  • Must be able to run composer install from remote server.
  • Application must be free of PHP errors.

Automated Changes

The Laravel Fixer automates the following changes:

  • Running the latest stable or LTS version of Laravel.
  • Applying your code style.
  • Using objects injected by Laravel where available.
  • Converting inline controller validation to Form Requests.
  • Referencing facades explicitly instead of globally.
  • Adopting composition over inheritance for Models and Controllers.
  • Removing unused folders from previous Laravel folder structures.
  • Replacing facade calls with Laravel helpers where available.
  • Converting routes to use static ::class references instead of strings.
  • Defining PHP type-hints in core Laravel classes.
  • Removing redundant typing from PHP DocBlocks.
  • Following recommendations listed in the Laravel Documentation.

For more details on the principles and practices behind code changes performed by the Laravel Fixer check out BaseLaravel.

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.