Laravel 9.4, weekly updates, and 🔥 tip
Laravel 9.4
There was a patch release last week. This week we have minor release with new features, quickly followed by another patch release. This brings us to Laravel 9.4.1.
Here are the highlights:
- Allow overriding transport type on Mailgun transporter in #41309
- Do not prepend
baseUrlto absolute urls in #41307 - Optionally cascade thrown
Flysystemexceptions in #41308 - Fix getting the trusted proxies IPs from the configuration file in #41322
- Allow chaining of
->newLine()for Commands in #41327 - Support for modifying a
charcolumn type in #41320 - Allow
whereNot()andorWhereNot()to work on column/value in #41296 - Allow
VerifyCsrfTokenCSRF cookie to be extended in #41342 - Add
Str::lcfirstin #41384 - Add
retryUntilmethod to queued Mailables in #41393
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 made a few more tweaks to the Laravel 9.x Shift based on user feedback. Mostly boundary case kind of stuff and improving the comments.
Also finished the outstanding Human Shifts. I'm all caught up on those. However, looks like my man Jacob Bennett is about to purchase one. He loves these things.
Jess and I crushed it last week by adding several new tasks to the Workbench. These include: adopting Laravel 9 helpers (str and to_route), removing guessable $model properties from factories, using Illuminate\Support\Carbon, converting to latest/oldest, expanding resource routes, and adopting the new single method for model accessors and mutators.
I go into more detail on these tasks in this Twitter thread. But probably more fun to just try them out in your own projects. A majority of these tasks are free to run.
Jess and I will continue adding more this week. But the pace will probably slow down as some of these additional tasks are complicated. For example, adopting stringables and removing "dead" routes.
🔥 Tip
On the topic of the Workbench here are some of the tasks I like to run.
Whenever I complete a Human Shift, I like to run the following tasks to clean up any outdated practices, either in Laravel or PHP.
- Short array syntax
- Use
::classconstant - Fix PHPUnit methods
- Global Facades references
- Adopt common helpers
- Model
$tableproperty - Model date casts
- Convert
$datesproperty - Streamline
orderBymethods - Convert
envtoconfig - Adopt class based routes
I like to run the following tasks periodically, even on my own projects. Again, to keep them following the conventions I prefer.
- Format code
switchtomatch- Adopt type hints
- Use Laravel Carbon
- Remove Laravel DocBlocks
- Compare core files
A friendly reminder, most of tasks are part of the Laravel Fixer. You may run that as an alternative if you didn't want to purchase a Workbench license or subscribe to a Shifty Plan.