Never Miss a Laravel Release 🚀
The Laravel team released version 12.36.0, adding concurrency control for HTTP pool and batch methods, introducing two Eloquent collection methods, and more. In addition, Inertial 2.x added support for View Transitions.
Inertia View Transitions
Pascal Baljet contributed view transitions via the View Transition API to Inertia 2.x. It works with router visits, links, and globally:
router.visit('/another-page', { viewTransition: true }) // Pass a callbackrouter.visit('/another-page', { viewTransition: (transition) => { transition.ready.then(() => doSomething()) transition.updateCallbackDone.then(() => doSomething()) transition.finished.then(() => doSomething()) },})
It also works with the <Link/> component, which accepts an empty attribute or callback:
<template> <Link href="/another-page" view-transition> Navigate </Link> <Link href="/another-page" :view-transition="(transition) => transition.finished.then(...)"> Navigate </Link></template>
Learn more about View Transitions in the documentation.
Http Client Concurrency Control
Wendell Adriel added Http client concurrency control to the Http::pool() and Http::batch() methods. It allows the ability to control how many concurrent requests the HTTP client can make:
$responses = Http::pool(fn (Pool $pool) => [ $pool->get('http://localhost/first'), $pool->get('http://localhost/second'), $pool->get('http://localhost/third'),], 2); // Sets the pool to have at max 2 concurrent HTTP requests $responses = Http::batch(fn (Batch $batch) => [ $batch->as('first')->get('http://localhost/first'), $batch->as('second')->get('http://localhost/second'), $batch->as('third')->get('http://localhost/third'),])->concurrency(2)->send(); // Sets the batch to have at max 2 concurrent HTTP requests
See Pull Request #57555 for implementation details.
setAppends() and withoutAppends() Eloquent Collection Methods
Luke Kuzmish contributed Eloquent collection methods to append attributes on each model:
// BeforeUser::query()->fillAndInsert( User::factory() ->count(100) ->make() ->each(fn ($u) => $u->setAppends([]))); // AfterUser::query()->fillAndInsert( User::factory() ->count(100) ->make() ->withoutAppends());
See Pull Request #57561 for details.
Allow Validator Message Placeholders to be Capitalized
Florian Raith contributed an update to extend placeholder capitalization beyond the :attribute placeholder:
// Example'same' => 'The :Attribute field must match :Other.', // Before: "The Password field must match :Other."// After: "The Password field must match Password confirmation."
See Pull Request #57556 for details.
Release notes
You can see the complete list of new features and updates below and the diff between 12.35.0 and 12.36.0 on GitHub. The following release notes are directly from the changelog:
v12.36.0
- [12.x] Remove return void from Http\Client\Batch's constructor by @rodrigopedra in https://github.com/laravel/framework/pull/57518
- [12.x] Namespace file cache lock keys by @faisuc in https://github.com/laravel/framework/pull/57516
- [12.x] Remove @return tag from constructor by @noir4y in https://github.com/laravel/framework/pull/57536
- [12.x] Add missing @throws annotation by @AhmedAlaa4611 in https://github.com/laravel/framework/pull/57535
- [12.x] allow chaining on setters by @browner12 in https://github.com/laravel/framework/pull/57532
- [12.x] Stop double prefixing S3 filesystem paths by @cosmastech in https://github.com/laravel/framework/pull/57534
- [12.x] test
Uribuilder methods by @browner12 in https://github.com/laravel/framework/pull/57549 - [12.x] Refactor
jsonSerialize()method to use match expression by @amirhshokri in https://github.com/laravel/framework/pull/57552 - [12.x] redirect response enforce same origin by @browner12 in https://github.com/laravel/framework/pull/57533
- [12.x] Add Eloquent Collection methods:
setAppends&&withoutAppendsby @cosmastech in https://github.com/laravel/framework/pull/57561 - [12.x] Fix buffer overflow when flushing Redis cache tags with many keys by @faisuc in https://github.com/laravel/framework/pull/57562
- [12.x] Allow validator message placeholers to be capitalized by @florianraith in https://github.com/laravel/framework/pull/57556
- Exclude property hooks on return of Model::__sleep() by @rafaelqueiroz in https://github.com/laravel/framework/pull/57557
- [12.x] Add concurrency control to Http::pool and Http::batch by @WendellAdriel in https://github.com/laravel/framework/pull/57555