Laravel 10.20, weekly updates, and 🔥 tip
Laravel 10.20
Couple new features this week brings us to Laravel 10.20. Here are the highlights:
- Allow default values when merging values into a resource in #48073
- Add
createOrFirst
toEloquent
in #47973 - Allow using
*Trashed()
methods onMorphTo
relationship in #47880 - Add ability to measure a single callable and get result in #48077
- Add
assertJsonPathCanonicalizing
in #48117 - Configurable storage path via environment variable in #48115
- Support providing subquery as value to
where
in #48116
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
Since I'm all caught up on Human Shifts, last week I focused mostly on the Shift CLI. Specifically porting over the premium tasks. I plan to release the alpha tomorrow with all of the free tasks. Then hopefully the premium tasks early next week.
It's been interesting as this is an open source project, with a paid side. So I needed to come up with a way to separate the premium tasks from the free tasks, but let them share the underlying classes. This led to a third, SDK type package. Which not only allows me to share code between the internal packages, but also provides a way for others to make their own automated tasks.
Once again, I did not get to the mid-cycle Shift. I'll remain focused on the Shift CLI until the alpha release. Then onto the next thing.
🔥 Tip
The Shift test suite uses a lot of fixtures. This allows me to quickly compare before/after versions of code. These fixtures contain namespaced classes, but their location violates PSR-4. So anytime composer dump-autoload
runs, I get a nice block of yellow warning me about several of the files in my tests/fixtures
folder.
I could move these out of the tests
folder (which is PSR-4 autoloaded). But I wanted to see if I could have Composer ignore them. It turns out you can with exclude-from-classmap
:
"autoload-dev": { "psr-4": { "Tests\\": "tests/" }, "exclude-from-classmap": [ "tests/fixtures/" ]},