Laravel 8.38, weekly updates, and 🔥 tip

Laravel 8.38

This week we have a few fixes and additions. So we increment to the next minor release of 8.38.0. Here are the highlights:

  • Fix required_if boolean validation in #36969
  • Fix merging object payload data in #36998
  • Fix anonymous and class based migration coexisting in #37006
  • Fix Http::withBody not being sent in #37057
  • Rename actingAs/be parameter in #36982
  • Add a Str::wordCount helper in #36990
  • Add PusherBroadcaster::setPusher in #37033
  • Allow the use of temporary views for testing Blade on Windows in #37044

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 I finished the Human Shifts and implemented some tweaks from using Shift myself. As I've said many times now, whenever I do Human Shifts it allows me to become a user. So anytime I find ways in which I might improve the automation, I go back and update the respective Shift.

Jess and I also finished the upgrade to Tailwind 2.x. Of course, we also used this as an opportunity to dogfood the new Tailwind Shifts. Although we took time to do a thorough visual review, there were only two main areas we needed to make changes.

Of course one of which was the colors. Tailwind has changed its color palette in every version. And because we were using Tailwind UI, there were some additional customizations. In the end, we actually followed Shift's recommendation of adopting the new colors, particularly the teal which gave the site a more Miami Vice feel.

The other was related to line heights. These are now defaulted by the text size utilities. So if you were setting line height explicitly, you potentially need to also set it for any of the responsive text sizes. Making this change manually gave me a better understanding of this, so I went back and wrote some automation for this.

This week I will continue to work on the secret project. I made some progress over the weekend, but came to the conclusion it would be easier to adopt Vue than continuing to write JavaScript rendering code. I often put off using these technologies from my tendency to practice YAGNI. However, finally time to use Vue in a project.

🔥 Tip

I recently upgrade all of Shift's stack to PHP 8. In doing so, I was reminded of the new match expression available in PHP 8. I really like how this expression streamlines the code. Particularly when there are multiple cases or return paths.

Here's a switch statement:

1switch ($statusCode) {
2 case 200:
3 case 300:
4 $message = null;
5 break;
6 case 400:
7 $message = 'not found';
8 break;
9 case 500:
10 $message = 'server error';
11 break;
12 default:
13 $message = 'unknown status code';
14 break;

And the corresponding match expression:

1$message = match ($statusCode) {
2 200, 300 => null,
3 400 => 'not found',
4 500 => 'server error',
5 default => 'unknown status code',

That's pretty 🔥. If you want to learn more about the match expression, check out this full comparison on