Laravel 12.51, weekly updates, and weekly tip
Laravel 12.51
Lots of fixes and additions in this week's release of Laravel 12.51. Here are the highlights:
- Add
BatchCancelledevent in #58627 - Allow callbacks in
firstOrCreateandcreateOrFirstin #58639 - Add
afterSending()toNotificationin #58654 - Add
timeout()to MySQL query builder in #58644 - Add
assertJobs()toPendingBatchFakein #58606 - Add
whenFails()andwhenPasses()toValidatorin #58655 - Allow passing array to
assertBatched()in #58659 - Add
withoutHeader()toResponsein #58671 - Add
viewData()toTestResponsein #58700 - Add
orderByPivotDesc()toBelongsToManyin #58720
You may review the full branch diff on GitHub for a complete list of changes.
Weekly Journal
Last week I continued working on the Livewire Shifts. I expect to release the Livewire 3.x Shift this week. While this Shift likely won't get used much given the outdated release, I still want to give it the same amount of polish I would a new release. I also want to ensure it goes above an beyond the Upgrade Guide and internal tool.
Otherwise, I had two Human Shifts come in. So any free time I had was spent on those. One was upgrading from Laravel 7. The other was consulting to squash an elusive bug. Still finding the ghost in the machine on that one…
Weekly Tip
My recent livestreams have been on the first case-study applying the Fast Laravel practices to community sites. The first being laravel-news.com.
The main refactor has been migrating away from Livewire. This has brought about some questions. I'd like to answer them here.
This is not "just because" or "anti-Livewire". Livewire is tightly coupled to the session. As such, it prevents a page from being cached. I did chat with Caleb about this back at Laracon US. But this coupling is rather fundamental to Livewire's design. Much like Laravel out-of-the-box enables sessions.
There are some community packages which claim to allow embedding Livewire anywhere. However, I was not able to get them to work reliably.
For these reasons, "Caching Livewire" is not covered in Fast Laravel. It's also why I need to refactor Laravel News away from Livewire if I want to cache the home and article pages.