Laravel 11.23, weekly updates, and 🔥 tip

Laravel 11.23

This release is huge as it includes all of the new features demoed at Laracon US. Here are the highlights for Laravel 11.23:

  • Update everyThirtyMinutes cron expression in #52662
  • Add minRatio and maxRatio rules on Dimension validation in #52482
  • Add more BackedEnum in #52679, #52677, and #52739
  • Add Skip middleware for Jobs in #52645
  • Add findOrFail to Eloquent\Collection in #52690
  • Laracon 2024 (Defer, Concurrency, Chaperone, etc) in #52710
  • Add Tag attribute in #52743
  • New when() helper for conditional output in #52665
  • Add fromUrl() to mail Attachment in #52688

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

This week has been chaotic to say the least. Honestly, I feel like I haven't been able to get on top of my task list. Which in turn kills my focus. Of course it doesn't help I went on family vacation, then Laracon, then sick, and now I'm solo-parenting for the week.

Anyway, last week was mostly reorganizing and reprioritizing outstanding items. In between, I worked on Human Shifts as that was paid hours. Internal Shift tasks came after, then side-projects.

To that point I broke ground on another side-project. This one with JT Smith. I am still working on the other with Caen and WPPM. In fact, WPPM had some solid use last week which may convert to the first paying customer.

Anyway, this week has been small tweaks to laravelshift.com and another Wednesday livestream. With the remainder of this week I hope to complete all Human Shifts and my refactor to Laravel's Process facade.

🔥 Tip

On the Process facade, one of the key takeaways in today's livestream was the automatic passing of ENV variables to any subprocess. This means whatever process you run from your Laravel app will receive all of the ENV variables from your Laravel app - like APP_KEY, DB_PASSWORD, etc.

This probably isn't a big deal if you're running a system command like ls. But it may be if you're running a custom program, or, in the case of Shift, another Laravel application. I learned this the hard way a few years ago.

This actually isn't something Laravel does explicitly, but what the wrapped Symfony Process does underneath. To prevent an ENV variable from being passed to the subprocess, you need to pass an array of environment variables with its name as the key and a value of false.

For example:

Process::env(['APP_KEY' => false, 'DB_PASSWORD' => false, ...])
->run('php script.php')

It is rather cumbersome to unset all ENV variables within a Laravel application. I'm considering some kind of PR to add a withoutAppEnv method. But really, a PR should probably go to Symfony to disable this at the lowest level. Ain't nobody got time for that. So for now, keep this behavior in mind.