Laravel 8.30, weekly updates, and 🔥 tip

Laravel 8.30

Lots of new features this week pushing us to 8.30.0. Here are the highlights:

  • Make Database Factory macroable in #36380
  • Respect custom route key with explicit route model binding in #36375
  • Add perMinutes for RateLimiting in #36352
  • Add buffered Console output in #36404
  • Add stopOnFirstFailure for validation in 39e1f84a
  • Add containsOneItem to Collection in #36428
  • Add context method within custom Exception in #36424

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

This minor 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 continued working on the new Tailwind Shifts. After a few alpha tests I realized some additional ways the Tailwind utilities may be used. So I spent most Friday building a parser for these edge cases. There's a few more to go, but it's a lot better and encapsulates this logic so it's easy to tweak.

We also need to finalize changes to the config file. Tailwind is a little different in regard to upgrading configuration. Particularly around the color palette. However, I want to align with the primary goal of Shift. So we're going to upgrade the configuration by default, but allow it to be an optional change. There will also be PR comments with any customizations you used so you may quickly copy and paste them back into your upgraded config file.

Jess and I also recorded a new episode of the BaseCode podcast, release this morning, starting our 5th season. We'll get deeper into the technical topics as this season progresses. This first one is mostly us catching up over the last six months.

Monday I bumped the prices for the Laravel 5.6, 5.7, and 5.8 Shifts. These now align with the $29 pricing tier, which represent unsupported versions of the framework.

I also updated the Shifty Plans. Anyone with an existing plan will be grandfathered into the comparable new plan at their next billing cycle. These plans are mostly the same, with the exception of the Upgrade Plan which now starts with the Laravel 6.x Shift as the latest LTS version.

I also changed the names to hopefully clarify their intent. The CI Plan was renamed to the Latest Plan, and the Upgrade Plan was renamed to the LTS Plan.

To fill any gap, I also created an Everything Plan. It's pretty straightforward - run any Shift for any repo. This is an annual plan as it's targeted at teams who manage multiple applications across various versions.

🔥 Tip

Array destructuring has been around since PHP 7.1. The obvious use case is replacing list or destructuring the returned array from explode.

However, a tweet from Nuno Maduro reminded me of another use case when assigning foreach loop variables.

Here is an example I used for testing the new Shifty Plans upgrade path where I unpack the two elements within a nested array to use within a foreach loop:

1foreach ($this->planCombinations() as [$current, $new, $expected]) {
2 $plan = Plan::factory()->make([
3 'name' => $current,
4 ]);
5 
6 $this->assertSame($expected, $plan->isUpgrading($new));
7}