Laravel 12.48, weekly updates, and weekly tip
Laravel 12.48
This weeks brings us to Laravel 12.48. Here are the highlights:
- Resolve infinite loop when using deferred queue #58373
- Ensure
Bus::chainfilters out falsy items #58369 - Translation lines may now contain square brackets and curly braces now #58367
- Add
skipWhen()toHandleCorsmiddleware #58361 - Allow setting flags for decoding JSON in the HTTP Client Response #58379
You may review the full branch diff on GitHub for a complete list of changes.
Weekly Journal
Last week I continued to crank out new Shifts. The Livewire 4.x Shift launched on Wednesday with the official release of Livewire 4. I got some good feedback on it over the weekend, and continue to tweak the automation as more edge-cases are reported.
To build out the catalog for the Livewire Shifts, I'm going to backfill a Livewire 3.x Shift. I'm also going to create an MFC Converter. This will convert from class-based components (in Livewire 3) to multi-file components (in Livewire 4). From MFC, you may use the internal tool to convert to single file components (SFC). However, it seems MFC have broader support. At least coming from class-based components.
I'm also finalizing the Laravel Cloud PreCheck. I believe we're launching that live next week during the Laravel Livestream. So I need to touch up a few things, then demo it to the team.
Since I'll launch that on Laravel's livestream, I'll start my first Fast Laravel case-study in my livestream tomorrow. In this stream, I'll run the new "Fast Laravel" Shift to configure the Laravel News application for caching. The goal will be to cache its landing page and article pages.
Between all that, I'm knocking out tasks for laravelshift.com. Inspired by the free Laracasts AI series, I finally (properly) set up my AI development workflow. This has given me confidence to allow AI to take point on the tedious tasks I never wanted to do.
Weekly Tip
Ran into a little brain-bender this morning. It made sense once I slowed down and thought about it. But it wasn't obvious to me at first.
A few of the pages on laravelshift.com have custom cache middleware. Here's its output from route:list:
GET|HEAD shifts ................ shifts › ShiftController@index ⇂ App\Http\Middleware\SetCacheControlHeader ⇂ Illuminate\Routing\Middleware\SubstituteBindings ⇂ App\Http\Middleware\ConditionalPageCache
Both the SetCacheControlHeader and ConditionalPageCache are post-middleware (run after response). But, I have two here. So which runs last?
By the output of their priority order, you might think that it ConditionalPageCache. But given that these are post-middleware, they are popped off the stack in reverse order. Or more technically, last in, first out order (LIFO).
So, SetCacheControlHeader runs last.
Because of this I needed to add some logic to only set the Cache-Control header if it was not already set (by ConditionalPageCache). In doing so, I also renamed it to DefaultCacheHeader.