Laravel 开源生态更新日志(2025年10月)
Laravel 开源生态的最新更新和改进。
Laravel Framework 12.x
[12.x] Ensure HTTP Batch Results Are Returned in the Same Order as Requested
Pull request by @jessarcher
Previously, Http::batch results were sorted in the order that the responses came back, rather than the order that the requests were defined:
dump(Http::batch(fn (Batch $batch) => [
$batch->get('https://httpbin.org/delay/3'),
$batch->get('https://httpbin.org/delay/2'),
$batch->get('https://httpbin.org/delay/1'),
])->send());
array:3 [
2 => Illuminate\Http\Client\Response {#419}
1 => Illuminate\Http\Client\Response {#374}
0 => Illuminate\Http\Client\Response {#328}
]The results are now sorted before they are returned, respecting any requests named with the as method. Learn more about request batching.
Add Support for Additional Editors in ResolvesDumpSource
Pull requests by @cseknowledge, @miguilimzero, @OmarFaruk-0x01, @Sajid-al-islam, and @Rakib01
Several PRs introduced new config values for app.editor, allowing dumps to link correctly for several new IDEs: neovim, zed, kiro, fleet, and windsurf.
Add Clickable File Reference for Thrown Exception
Pull request by @jasonmccreary
The recently introduced new exception page now includes a new file reference and line number that opens the file directly in your IDE of choice.
[12.x] Add SQS FIFO and Fair Queue messagegroup() Method Support
Pull request by @patrickcarlohickman
Instead of using the onGroup() method at the time of dispatch, you can now define a messageGroup() directly method on the job class, removing an inconsistency where event listeners supported the messageGroup() method on the class, but all the other job types required calling onGroup().
Deferred Queue
Pull request by @taylorotwell
Using deferred synchronous dispatching, you can dispatch a job to be processed during the current process, but after the HTTP response has been sent to the user. This allows you to process "queued" jobs synchronously without slowing down your user's application experience. To defer the execution of a synchronous job, dispatch the job to the deferred connection:
RecordDelivery::dispatch($order)->onConnection('deferred');Failover Cache
Pull request by @taylorotwell
The failover cache driver provides automatic failover functionality when interacting with the cache. If the primary cache store fails for any reason, Laravel will automatically attempt to use the next configured store in the list. This is particularly useful for ensuring high availability in production environments where cache reliability is critical.
'failover' => [
'driver' => 'failover',
'stores' => [
'database',
'array',
],
],[12.x] PostgreSQL Virtual Columns
Pull request by @tpetry
PostgreSQL 18 was recently released, along with it support for virtual generated columns. The virtualAs column modifier now has backwards compatible support this new PostgreSQL feature.
Failover Queue
Pull request by @taylorotwell
The failover queue driver provides automatic failover functionality when pushing jobs to the queue. If the primary queue connection fails for any reason, Laravel will automatically attempt to push the job to the next configured connection in the list. This is particularly useful for ensuring high availability in production environments where queue reliability is critical.
'failover' => [
'driver' => 'failover',
'connections' => [
'redis',
'database',
'sync',
],
],[12.x] Add Defer Method to HTTP Batch
Pull request by @WendellAdriel
When the new defer method is invoked on Http::batch, the batch of requests is not executed immediately. Instead, Laravel will execute the batch after the current application request's HTTP response has been sent to the user, keeping your application feeling fast and responsive:
use Illuminate\Http\Client\Batch;
use Illuminate\Support\Facades\Http;
$responses = Http::batch(fn (Batch $batch) => [
$batch->get('http://localhost/first'),
$batch->get('http://localhost/second'),
$batch->get('http://localhost/third'),
])->then(function (Batch $batch, array $results) {
// All requests completed successfully...
})->defer();Inertia
Configure Global Defaults and Update During Runtime
Pull request by @pascalbaljet
Inertia now supports setting app-wide defaults, with the ability to update values at runtime. You can pass a default config object to the createInertiaApp() method:
createInertiaApp({
// resolve, setup, etc.
defaults: {
form: {
recentlySuccessfulDuration: 5_000,
},
prefetch: {
cacheFor: 60_000,
},
visitOptions: (href: string, options: VisitOptions) => {
return { headers: { ...options.headers, "X-Foo": "Bar" } };
},
},
});Each adapter now also exports a config instance to update any values at runtime:
import { config } from "@inertiajs/vue3";
config.set("form.recentlySuccessfulDuration", 1000);Support for Type-Hinting Shared Page Props
Pull request by @pascalbaljet
usePage() now supports a global type definition file, allowing you to type-hint shared page props:
// resources/js/types/globals.d.ts
declare module "@inertiajs/core" {
export interface InertiaConfig {
sharedPageProps: {
auth: { user: { id: number; name: string } | null };
flash: { success?: string; error?: string };
};
}
}Shared page props are now automatically type-hinted throughout the app when you use usePage():
const page = usePage();
const successMessage = page.props.flash.success;Boost
Dynamic NPM Package Runner
Pull request by @imliam
Boost now detects which NPM package manager should be used to run any given script (npm, pnpm, yarn and bun). This assists the AI in using the correct CLI tools when running npm commands based on the project's existing dependencies.
Add Support for Custom Code Environments
Pull request by @pushpak1300
You can now create custom code environments (IDEs and AI agents) for Boost. Previously, Boost only supported a hardcoded list of environments, which made it difficult to add support for new IDEs or agents directly within the official Boost repository.
use Laravel\Boost\Contracts\Agent;
use Laravel\Boost\Contracts\McpClient;
use Laravel\Boost\Install\CodeEnvironment\CodeEnvironment;
class MyCustomIDE extends CodeEnvironment implements Agent, McpClient
{
// Implementation
}Registering your custom code environment:
use Laravel\Boost\Boost;
Boost::registerCodeEnvironment('myide', MyCustomIDE::class);Fortify
Add Laravel Fortify Guidelines for Boost
Pull request by @pushpak1300
AI guidelines were added which can be used by Laravel Boost's Third-Party Package AI Guidelines. This is completely opt-in for each user, they can choose if they want additional intelligence around Fortify's usage with their Laravel application.
Horizon
Allow Naming of Horizon Instances
Pull request by @timacdonald
When you have several Horizon instances running in different regions, all within a single application, it can be difficult to determine with instance of Horizon a notification is originating from. You can now specify a name for each instance, making identification straightforward.
Before:
Long Wait Detected
[Nightwatch] The "{queue}" queue on the "{connection}" connection has a wait time of {seconds} seconds.After:
Long Wait Detected
[eu-central-1] The "{queue}" queue on the "{connection}" connection has a wait time of {seconds} seconds.Installer
Pass Flags for Alternative Node Package Managers
Pull request by @joetannenbaum
When running laravel new, there are now additional flags you can pass to specify which Node package manager you'd like to use: --npm, --pnpm, --bun, or --yarn. Passing one of these flags will also update any composer script that references a Node command to reflect the correct command specific to the selected package manager.
Starter Kits
Integration of Additional Fortify Features
Pull requests by @pushpak1300
All starter kits now use Fortify for login, registration, password reset, and email verification. Fortify is a battle-tested solution, removing code from your codebase that is rarely changed, keeping your application code streamlined and maintainable.
Scout
Full-Text Improvements
Pull request by @taylorotwell
Several improvements to full-text support were added when using the database engine. First up, you can now pass multiple columns to orWhereFullText in a single call. Secondly, when using Postgres and no other developer-provided ordering has been defined, Scout automatically adds relevance-based ordering by default to match MySQL's built-in ordering behavior.