Laravel 9.49, weekly updates, and 🔥 tip

Laravel 9.49

Lots this week as it contains two weeks worth of changes. Most of the Laravel team was at Laracon EU last week, so there was not a release.

With Laravel 10 scheduled to be released next week, this may be last weekly release for Laravel 9. Here are the highlights for Laravel 9.49:

  • Ensure broadcast channel matches from start of string in #45692
  • Fix flushdb on cluster in #45544
  • Add noActionOnDelete() cascade option in #45712
  • Add throw* methods to the HTTP Client in #45704
  • Add support for casting arrays containing enums in #45621
  • Add missing validation rules in #45717
  • Add forceDeleteQuietly to SoftDeletes in #45737
  • Add Arr::sortDesc() in #45761
  • Add prompts to artisan make commands in #45629
  • Add assertJsonIsArray and assertJsonIsObject to TestResponse in #45731
  • Add createQuietly to HasOneOrMany in #45783
  • Add ascii validation rules in #45769
  • Add skip cancelled middleware in #45869
  • Add intersect* methods to Collection in #45839
  • Support backed enum for @js in #45862
  • Add forceDeleting event in #45836

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

Izzy is doing much better and returned to daycare last week. This allowed me time to finally catch up on work. Specifically creating the Laravel 10.x Shift. I successfully alpha tested with Jess Archer, Joel Clermont, and Luke Downing. So I quietly launched the beta version yesterday.

Of course, Laravel 10 will not be released until February 7. But I like to have something early for the beta testers. I also offer it at a discount to benefit both sides - I get more test runs and users save a few bucks. Anyone who runs the Laravel 10.x Shift now may request a rerun after the official release.

While there might be more changes to Laravel itself, the main focus is package compatibility. Yesterday I ran automation for over 500 of the popular community packages. This automation mainly bumps the dependencies for Laravel 10. There's often more work that needs to be done. But I like to think it helps the package authors get started and gives early adopters something to test.

🔥 Tip

The biggest thing in Laravel 10 will be the addition of type hints to user-land code. Many have wondered how this will affect their code. The short version is: adding type hints will be optional. Mostly.

The long version is: it depends. Type hints are not being added to the underlying framework. Only some of the contracts and underlying classes have type hints. The code which lives within your application is mostly dynamically called by Laravel. As such, there is no formal interface or inheritance your application follows.

So, you are only required to add type hints to the Laravel classes you extend or interfaces you implement which have type hints. Again, that's not a lot. Really just the Cast and Rule classes, and potentially a few of the ServiceProvider methods.

With all that said, Shift will automate the addition of type hints as provided in a new Laravel 10 application. This is inline with Shift's goal to always give you an up-to-date application and adopt Laravel's latest conventions. Of course, these changes are made within atomic commits. So if you have strong feelings against types, you may revert them.