Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Browse all series

Automated Laravel Upgrades

Hi! I'm Jason McCreary. I'm the founder of Laravel Shift, a popular service that provides automatic upgrades for your Laravel applications. In this CreatorSeries, using all of the knowledge I've acquired over the years of building and maintaining Shift, I'll show you how to automate many of your every-day development tasks.

Progress

Series Info

Episodes
13
Run Time
2h 16m
Difficulty
Advanced
Last Updated
Apr 24, 2023
Version
Latest

Series Episodes

  1. Episodes (13)
    1. PHPLint and Validation

      Before we can get started, we first need to validate our code using phplint. Once we understand the basics, we'll then write a short PHP script that runs phplint across all relevant PHP files within our current project.
    2. Error Message Parsing

      In this episode, we'll take ten minutes or so to optimize the output of our linter script. We'll leverage regular expressions to only expose the error details that we most care about.
    3. Automate the Automation

      Now that we have the scripts and tools to automate certain portions of our development workflow, it would be nice to next... automate the automation.
    4. Detect Accidental Debugging Statements

      Now that we've successfully automated the automation, it's time to build some custom scripts. Why don't we start with a script that detects any lingering var_dump, print_r, or other similar debugging statements.
    5. Automatically Remove Debugging Statements

      Now that our debug script is finding the calls that we actually care about, we can take things one step further. Let's write a script that automatically removes these lingering statements from the code!
    6. Streamlining Script Execution With Laravel Zero

      It's currently a bit cumbersome to run our debug scripts. To remedy this, let's pull in Laravel Zero. We'll discuss its installation, and then transition our code to a more object-oriented structure.
    7. Task Discovery

      In this lesson, I'll demonstrate how to implement auto-discoverability for our tasks. This way, anyone can contribute and include their own tasks as part of our command runner.
    8. Automate Eloquent Method Ordering

      For our final example of automation, let's work on something a bit more complex. We'll write a script that ensures that the methods of an Eloquent model are displayed in the correct order.
    9. Automate Eloquent Method Ordering: Part 2

      Now that we have all the pieces of our model class, next we can move on to sorting them in the appropriate order. We'll tackle constant, property, and method ordering.
    10. Discovering Relationships in PHP Models

      In this episode, we explore how to identify relationship methods in PHP models using regular expressions and update our finder to recognize these methods. We can then sort the methods by type or name depending on our preference.
    11. Organizing Model Classes in Laravel

      In this final episode, I'll demonstrate how to organize methods, properties, and constants within a model class in Laravel. We'll also review some valuable tips on how to refactor code and build automation using the Abstract Syntax Tree.

Continue Learning