Laravel 8.77, weekly updates, and 🔥 tip

Laravel 8.77

A few new features in this week's release of Laravel 8.77.0. There was also one I didn't mention in last week's patch release. I've highlighted them all below:

  • Add doesntContain method to Collection and LazyCollection in #40044
  • Attribute Casting and Accessor Improvements in #40022
  • Consistently negate conditions in @includeUnless Blade directive in #40077
  • Translate Enum rule message in #40089
  • Add date parsing to Request in #39945
  • Ability to use prefixes on Predis per Connection in #40083
  • Add validation rule for MAC address in #40098
  • Ability to define temporary URL for Storage in #40100

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 continued working on the Human Shifts that came in over vacation. Got one of them done. The other is being used for pairing sessions. So I'll likely complete those after the holidays.

Jess and I also dogfooded the new Tailwind 3.x Shift by upgrading laravelshift.com. I published a recording on YouTube. It took us about 20 minutes and we fixed some form styling off-screen. Shift now detects that change as well. I also added them to a Gist.

Over the weekend, I took the opportunity to clean up some of the Shift codebase. I mostly did so with Workbench tasks like: Format test cases, Adopt Type Hints, and Remove redundant DocBlock tags. All tedious changes I didn't want to make by hand, but were bugging me.

Today I continued live streaming to build a new Laravel application from scratch. I'm using it as an excuse to try out Livewire and authorization policies. Two things I've yet to use within my Laravel apps.

That'll likely be my focus the rest of this week. I think Jess and I will pair once more to continue to refactor the Shift codebase so we're ready to start building the Laravel 9.x Shift in January. Otherwise, I'm taking time off for the holidays.

🔥 Tip

Blade comes with so many directives. I like when I get the chance to use an uncommon one. Last week, I found the opportunity to use includeUnless.

I actually tweeted about this refactor last week. However, here's the before and after:

{{--- before ---}}
@unless($excludeFlash ?? false)
@include('partials.flash-message')
@endunless
 
{{--- after ---}}
@includeUnless($excludeFlash ?? false, 'partials.flash-message')

After this refactor, I encountered an operator error. I ultimately continued to refactor the code to remove the null coalesce. So I moved on.

After posting on Twitter, some considered the error a bug. Although it was unexpected, I'm reluctant to call things a bug.

In the end, it actually was a bug. Mark Jaquith opened a PR with a fix. Which was merged and available in this week's release. 🔥