Laravel 10.14, weekly updates, and 🔥 tip

Laravel 10.14

After a few weeks off, Laravel 10.14.0 was tagged. Here are the highlights:

  • Allow serialization of NotificationSent in #47375
  • Ability to custom denial response for Gate in #47436
  • Add getNamespace to Factory in #47463
  • Add whenAggregated to ConditionallyLoadsAttributes in #47417
  • Add withHeader to PendingRequest in #47474
  • Fix $exceptTables to allow an array of table names in #47477
  • Allow object caching to be disabled for custom class casters in #47423
  • Add can validation rule to use policies in #47371
  • Add withQueryParameters to the HTTP client in #47297
  • Allow % symbol in component attribute names in #47533
  • Add hasAny to ComponentAttributeBag to allow multiple keys in #47569
  • Ensure captured time is in configured timezone in #47567
  • Add global middleware to HTTP client in #47525

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 paired with Jess to continue working on the Shift CLI. This gave me the motivation I needed to finish porting over the remaining free tasks from the Shift Workbench. I also set up a testing harness to make it easy to test these.

I'm excited to release an alpha version of this in the coming weeks. I've always dreamed of opening up Shift in some way for the Laravel community to be able to contribute automation. Since the Shift CLI will be open source and have the ability to "discover" tasks, it'll be easy for the community to create their own which are auto-registered much like modern Laravel packages.

This week I'll continue working on the Shift CLI as well as start my talk for Laracon US.

🔥 Tip

I tweeted this last week, but I am growing more open to having tests be a little bit "smart" - especially when they directly test the framework.

The example is using the __() translation helper to render a validation error message instead of hard coding the message as a string. This is nice as my test doesn't suddenly fail when the default validation messages change (which, historically, they do often).

I'm thinking about adding a custom assertion for this so you don't have to write a long __() line in your tests. So let me know in a reply or on Twitter if you'd find that valuable.