Laravel 8.54, weekly updates, and 🔥 tip

Laravel 8.54

There was a patch release last week, as well as a lot of fixes and a few new features this week bringing Laravel to 8.54.0.

Here are the highlights:

  • Fix signed routes in #38249
  • Fix placeholders replaced for accepted_if validation message in #38240
  • Fix Factory hasMany method in #38319
  • Wrap column name inside subQuery of hasOneOfMany in #38263
  • Added support for GCM encryption in #38190
  • Pass exception to missing() callbacks in #38289
  • Add bitwise not operator in #38316

You may review the full branch diff on GitHub for a complete list of changes.

This version bump and update is automated for subscribers to a Shifty Plan. If you don't have one of those, be sure to bump your constraint and run composer update to get the latest features.

Weekly Journal

Last week Jess and I fixed a few more of the outstanding issues for the Workbench desktop app. This included a Windows regression and some cases where Laravel tasks were not scanning autoloaded paths.

We spent the rest of the week pairing on some outstanding bugs when doing version comparisons. This is used not only by Workbench tasks, but also the weekly automation and Dependency Upgrader.

I pushed a partial patch live this morning to test in today's automation. I also plan to work on honoring your projects PHP version. This will help correctly set packages, like Spatie, which often bump their PHP versions ahead of Laravel's requirements.

I also finalized a new task for formatting tests cases. This was to scratch my own itch as the Shift test suite had grown inconsistent over the years. I live-streamed the creation of most of this task, and launched it at the end of the week. It's configurable with some common styles for applying annotations, prefixes, and method casing.

I feel like this is another standalone task. If you wanted to normalize the code style of a large test suite this task alone would make the Workbench totally worth it. And there's 40 other tasks you'd be able to run too. With more added every month.

We also added a section on laravelshift.com to emphasize the "pain points" of upgrading. This is a popular section for a landing page. Although Shift has been around for a while, and most understand what it does, I think it's good to explicitly address these. It also gives us an opportunity to have a little more fun with the content.

🔥 Tip

The other week I needed to filter items in an array based on a regular expression. A sort of prefix matching. I assumed I would do this with a combination of array_filter and str_starts_with (or a collection pipeline).

However, I stumbled upon the PREG_GREP_INVERT flag for preg_grep which allowed me to do all this in one step. 🔥

1$paths = preg_grep(
2 '/^(' . implode('|', $prefixes) . ')\//',
3 $paths,
4 PREG_GREP_INVERT
5);