Laravel 8.80, weekly updates, and 🔥 tip

Laravel 8.80

Couple new features in this week's release of Laravel 8.80. More math fun in the version numbers: 8 - 8 = 0

Anyway, here are the highlights:

  • Allow enums as entity_type in morphs in #40375
  • Add support for specifying a Route::group controller in #40276
  • Add phpredis serialization and compression config support in #40282
  • Add Blade::render() to render a string with Blade syntax in #40425
  • Add sortKeysUsing to Collection in #40458

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 I live streamed a couple additions to Laravel. Two of these ended up getting closed. Fortunately, the other more important one got merged.

I spent the rest of the week completing the automation for all of the various changes in Laravel 9. At first, Laravel 9 seemed to mostly be a maintenance release. However, there are actually a lot of changes. Especially when you consider all of the changes during Laravel 8.

Shift's goal is to take a Laravel 8.0 application and make it a Laravel 9.0 application. So, Shift always does more than what's listed in the Upgrade Guide. In this case, that's a lot since it's been 15 months instead of the normal 6 months between releases. Nearly every file in a default Laravel app changed.

All the currently known changes are complete. So I plan to release a beta of the Laravel 9.x Shift tomorrow. I'll continue watching the Upgrade Guide and change log to automate any last minute additions.

This week I'll also live stream some additional work on Project A. I hope to get it feature complete by the end of the week. After which, I'd like to transition into more live streams related to Shift.

To that point, I asked on Twitter for any real world Laravel applications I could upgrade in these live streams. So, if you have one, feel free to DM me. I'll upgrade multiple, so there's a good chance yours will be chosen.

🔥 Tip

Something in PHP I don't use very often and actually didn't stumble upon until deep in my PHP career is the ability to jump out of nested control structures.

Both continue and break support a numeric argument. The default is 1.

I recently used this in the Laravel 9.x Shift to recreate the behavioral equivalent of a firstWhere or contains method.

foreach ($paths as $path) {
$instances = $validation->parse(Shift::getFileContents($path));
 
foreach ($instances as $instance) {
if ($this->containsArrayRule($instance)) {
$references[] = $path;
 
continue 2;
}
}
}