Zum Inhalt springen

Laravel Framework Updates & Release Notes

Einträge
234
Quellen
1
Zuletzt aktualisiert

Folge Laravel Framework, um die Release Notes in deinen Feed zu holen.

Laravel Framework von Laravel

Laravel 13.x: Multi-Type-Unions in Illuminate\JsonSchema

Illuminate\JsonSchema kann nun Schemas mit einem Array als type (z. B. ['string', 'number', 'boolean']) abbilden, die zuvor eine Exception auslösten, und bietet dafür auch JsonSchema::union().

Pull request by @pushpak1300

Illuminate\JsonSchema can now represent multi-type union schemas - schemas where the type field is an array like ['string', 'number', 'boolean']. This comes up frequently with third-party MCP tool schemas where mixed types are common. Previously these would throw an exception; now they deserialize, serialize, and round-trip correctly.

// Now works where it used to throw
JsonSchema::fromArray(['type' => ['string', 'number', 'boolean']]);

// Or build one directly
JsonSchema::union(['string', 'number'])->nullable();

Originalquelle(öffnet in neuem Tab)Problem melden

Laravel Framework von Laravel

Laravel 13.x: Cache::rememberWithState()

Cache::rememberWithState() gibt neben dem gecachten Wert auch einen Boolean zurück, der anzeigt, ob es ein Cache-Treffer oder -Fehlschlag war.

Pull request by @cosmastech

Cache::rememberWithState() returns both the cached value and a boolean indicating whether it was a hit or miss - useful for debugging, recording cache metrics, or surfacing cache status in response headers without having to check the cache twice.

Originalquelle(öffnet in neuem Tab)Problem melden

Laravel Framework von Laravel

Laravel 13.x: normalize-Parameter für Str::studly() und Str::pascal()

Mit normalize: true werden komplett großgeschriebene Wortsegmente vor der Umwandlung kleingeschrieben, sodass Strings wie CBOR zu Cbor werden, während gemischt geschriebene Strings unverändert bleiben.

Pull request by @hotmeteor

All-uppercase strings like CBOR or ALL_CAPS now have a path through Str::studly() and Str::pascal() that produces the expected output. Pass normalize: true and any fully-uppercased word segment gets lowercased before conversion - mixed-case strings are left alone as before.

Str::studly('CBOR', normalize: true)      // 'Cbor'
Str::studly('ALL_CAPS', normalize: true)  // 'AllCaps'
Str::studly('AllJersey', normalize: true) // 'AllJersey' (unchanged)

Originalquelle(öffnet in neuem Tab)Problem melden

Laravel Framework von Laravel

Laravel: Client\Request::uri() für den HTTP-Client

Das Request-Objekt des HTTP-Clients hat jetzt eine uri()-Methode, die eine Illuminate\Support\Uri-Instanz zurückgibt und Http::assertSent()-Callbacks vereinfacht.

Pull request by @stevebauman

The HTTP client's Request object now has a uri() method that returns an Illuminate\Support\Uri instance, consistent with the uri() method already available on Illuminate\Http\Request. This makes Http::assertSent() callbacks a lot cleaner when you need to inspect the URL.

Http::assertSent(function (Request $request) {
    return $request->uri()->path() === '/api/users'
        && $request->uri()->query()->integer('page') === 2;
});

Originalquelle(öffnet in neuem Tab)Problem melden

Laravel Framework von Laravel

Laravel Framework 13.18.0

Version 13.18.0 reduziert Cache-Zugriffe bei debounced Jobs, ergänzt prioritätsbasierte Registrierung für Dev-Befehle und Informationen im WorkerStopping-Event und behebt mehrere Fehler, etwa bei Cache-Headern auf HEAD-Requests, RateLimited-Middleware und Number::forHumans().

Originalquelle(öffnet in neuem Tab)Problem melden

Laravel Framework von Laravel

schema:dump mit Flag --without-migration-data

Der Befehl schema:dump akzeptiert jetzt das Flag --without-migration-data, das die Zeilen der Migrationstabelle aus dem Dump entfernt und nur die Struktur ausgibt.

Pull request by @jackbayliss

schema:dump now accepts a --without-migration-data flag that strips migration table rows from the output, leaving you with a clean structural dump. Handy for test environments where you want to seed the schema without carrying over migration history from another environment.

php artisan schema:dump --without-migration-data

Originalquelle(öffnet in neuem Tab)Problem melden

Laravel Framework von Laravel

between()/unlessBetween() unabhängig von der timezone()-Reihenfolge

Wird between() oder unlessBetween() vor timezone() aufgerufen, wird die angegebene Zeitzone nun korrekt berücksichtigt, weil die Zeitprüfung erst bei Ausführung des Filters erfolgt.

Pull request by @ManicardiFrancesco

Previously, calling between() or unlessBetween() before timezone() in a schedule chain would silently use UTC regardless of what timezone you specified - a subtle bug that could have scheduled tasks running at the wrong hour in production. The time-interval check is now deferred until the filter executes, so the order no longer matters.

// Both of these now behave identically
$schedule->command('foo')->timezone('Europe/Rome')->between('10:00', '12:00');
$schedule->command('foo')->between('10:00', '12:00')->timezone('Europe/Rome');

Originalquelle(öffnet in neuem Tab)Problem melden

Laravel Framework von Laravel

Neuer Befehl php artisan dev

php artisan dev startet Server, Queue Worker, Log-Tailing und Vite gleichzeitig mit farblich getrennter Ausgabe, erkennt den Node-Paketmanager automatisch und lässt sich über Service Provider um weitere Befehle erweitern.

Pull request by @joetannenbaum

php artisan dev brings all your development processes together in one command - server, queue worker, log tailing, and Vite running concurrently, each with its own color-coded output. It replaces the composer dev script with a proper Artisan convention and auto-detects your Node package manager (npm, yarn, pnpm, or bun).

You can register additional commands from a service provider - useful for tools like Reverb or Stripe's CLI webhook listener:

use Illuminate\Foundation\Console\DevCommands;

DevCommands::artisan('reverb:start', 'reverb')->orange();
DevCommands::register('stripe listen --forward-to ' . config('app.url'))->green();

Originalquelle(öffnet in neuem Tab)Problem melden

Laravel Framework von Laravel

Maintenance-Mode-Treiber array für paralleles Testen

Ein neuer In-Memory-Treiber array hält den Maintenance Mode pro Prozess isoliert und vermeidet so Race Conditions bei parallelen Test-Suites.

Pull request by @ziadoz

Parallel test suites and the file-based maintenance mode driver don't mix well - shared state on disk leads to race conditions between workers. The new in-memory array driver keeps maintenance mode isolated per process, mirroring the same pattern used by the cache and session drivers. No more flaky tests caused by leftover maintenance mode files.

Originalquelle(öffnet in neuem Tab)Problem melden

Laravel Framework von Laravel

Neue Methode whenFilledEnum in InteractsWithData

whenFilledEnum() führt den Callback nur aus, wenn der Schlüssel vorhanden ist und der Wert einem gültigen Enum-Case entspricht, und übergibt eine typisierte Enum-Instanz.

Pull request by @astandkaya

Working with backed enums in request data used to mean a whenFilled() call followed by a tryFrom() check and a null guard. whenFilledEnum() collapses all of that into a single method that only fires the callback when the key is present, the value maps to a valid enum case, and you get a typed enum instance in the closure - no manual validation needed.

// Before
$request->whenFilled('status', function (string $input) use ($query): void {
    $status = Status::tryFrom($input);
    if ($status === null) {
        return;
    }
    $query->where('status', $status);
});

// After
$request->whenFilledEnum('status', Status::class, function (Status $status) use ($query): void {
    $query->where('status', $status);
});

Originalquelle(öffnet in neuem Tab)Problem melden

Laravel Framework von Laravel

anyOf-Unterstützung in JSON Schema

Illuminate\JsonSchema unterstützt jetzt anyOf, was für KI-Szenarien mit strukturierter Ausgabe nützlich ist, in denen ein Feld mehrere unterschiedliche Formen annehmen kann.

Pull request by @dbpolito

Illuminate\JsonSchema now supports anyOf, which is essential for AI structured output scenarios where a field can resolve to one of several distinct shapes. Both OpenAI and Gemini support anyOf in their structured output APIs, so this unlocks more expressive schema definitions when building AI-powered features with Laravel AI.

Originalquelle(öffnet in neuem Tab)Problem melden

Laravel Framework von Laravel

Neu: Bus::bulk() für effizientes Queueing vieler Jobs

Bus::bulk() gruppiert Jobs nach Queue und Connection und führt pro Gruppe nur einen einzigen Bulk-Insert aus, statt jeden Job einzeln zu schreiben.

Pull request by @jackbayliss

When you need to queue a large number of jobs at once, Bus::bulk() is the most efficient way to do it. Rather than dispatching jobs one by one (one database insert each) or using a batch (which writes on every completion), Bus::bulk() groups jobs by queue and connection and performs a single bulk insert per group. No overhead, no per-job write costs.

Bus::bulk(
    $users->map(fn (User $user) => new ProcessUser($user))->all()
);

Originalquelle(öffnet in neuem Tab)Problem melden

Laravel Framework von Laravel

attachFromStorage-Helfer für Notification MailMessage

MailMessage in Notifications bietet nun attachFromStorage() und attachFromStorageDisk(), um Dateien direkt aus dem Storage anzuhängen, wie es bei Mailable schon möglich war.

Pull request by @LucasCavalheri

MailMessage in notifications now has attachFromStorage() and attachFromStorageDisk() methods, matching what Mailable has offered for a while. Attach invoices, reports, or any file from your storage layer without having to read the contents yourself first.

(new MailMessage)
    ->attachFromStorage('invoices/1.pdf')
    ->attachFromStorageDisk('s3', 'invoices/1.pdf', 'Invoice.pdf', [
        'mime' => 'application/pdf',
    ]);

Originalquelle(öffnet in neuem Tab)Problem melden

Laravel Framework von Laravel

Multi-Type-Unions in Illuminate\JsonSchema

Illuminate\JsonSchema kann nun Schemas mit mehreren Typen im Feld type (z. B. ['string', 'number', 'boolean']) darstellen, statt wie bisher eine Exception zu werfen.

Pull request by @pushpak1300

Illuminate\JsonSchema can now represent multi-type union schemas - schemas where the type field is an array like ['string', 'number', 'boolean']. This comes up frequently with third-party MCP tool schemas where mixed types are common. Previously these would throw an exception; now they deserialize, serialize, and round-trip correctly.

// Now works where it used to throw
JsonSchema::fromArray(['type' => ['string', 'number', 'boolean']]);

// Or build one directly
JsonSchema::union(['string', 'number'])->nullable();

Originalquelle(öffnet in neuem Tab)Problem melden

Laravel Framework von Laravel

Cache::rememberWithState()

Cache::rememberWithState() liefert neben dem gecachten Wert auch einen booleschen Hinweis, ob es ein Treffer oder Fehlschlag war.

Pull request by @cosmastech

Cache::rememberWithState() returns both the cached value and a boolean indicating whether it was a hit or miss - useful for debugging, recording cache metrics, or surfacing cache status in response headers without having to check the cache twice.

Originalquelle(öffnet in neuem Tab)Problem melden

Laravel Framework von Laravel

Parameter normalize für Str::studly() und Str::pascal()

Mit normalize: true werden komplett großgeschriebene Wortsegmente vor der Umwandlung kleingeschrieben, sodass etwa aus CBOR das Ergebnis Cbor wird.

Pull request by @hotmeteor

All-uppercase strings like CBOR or ALL_CAPS now have a path through Str::studly() and Str::pascal() that produces the expected output. Pass normalize: true and any fully-uppercased word segment gets lowercased before conversion - mixed-case strings are left alone as before.

Str::studly('CBOR', normalize: true)      // 'Cbor'
Str::studly('ALL_CAPS', normalize: true)  // 'AllCaps'
Str::studly('AllJersey', normalize: true) // 'AllJersey' (unchanged)

Originalquelle(öffnet in neuem Tab)Problem melden

Laravel Framework von Laravel

Client\Request::uri() im HTTP-Client

Das Request-Objekt des HTTP-Clients hat jetzt eine uri()-Methode, die eine Illuminate\Support\Uri-Instanz zurückgibt und Prüfungen in Http::assertSent() vereinfacht.

Pull request by @stevebauman

The HTTP client's Request object now has a uri() method that returns an Illuminate\Support\Uri instance, consistent with the uri() method already available on Illuminate\Http\Request. This makes Http::assertSent() callbacks a lot cleaner when you need to inspect the URL.

Http::assertSent(function (Request $request) {
    return $request->uri()->path() === '/api/users'
        && $request->uri()->query()->integer('page') === 2;
});

Originalquelle(öffnet in neuem Tab)Problem melden

Laravel Framework von Laravel

Laravel 13.x: Blade-Direktive @fonts und Vite-Font-Optimierung

Die neue Blade-Direktive @fonts liest vom Vite-Font-Plugin erzeugte Manifeste und fügt automatisch Preload-Links, Inline-Styles und Push-Header ein, optional beschränkt auf bestimmte Font-Aliase.

Pull request by @WendellAdriel

Loading web fonts has always involved a bit of ceremony - preload links, @font-face rules, HTTP/2 server push headers. The new @fonts Blade directive handles all of that automatically by reading font manifests generated by the Vite font plugin, injecting the right <link rel="preload"> tags, inline styles, and push headers in one shot.

<!DOCTYPE html>
<html>
    <head>
        @fonts
        @vite("resources/js/app.js")
    </head>
</html>

Need only a subset of your configured families on a given page? Pass their aliases:

@fonts(["sans", "mono"])

Originalquelle(öffnet in neuem Tab)Problem melden

Laravel Framework von Laravel

Laravel 13.x: Neuer Cache-Store storage

Das Cache-System unterstützt nun einen dateisystembasierten storage-Treiber, mit dem sich ein vorhandener Disk wie S3 als Key/Value-Cache nutzen lässt.

Pull request by @taylorotwell

Laravel's cache system now supports a storage driver backed by the filesystem, making it straightforward to use an existing disk - like S3 - as a key/value cache without any additional infrastructure.

Originalquelle(öffnet in neuem Tab)Problem melden

Laravel Framework von Laravel

Laravel 13.x: Optionaler Disk-Speicher für große SQS-Queue-Payloads

Über extended_store_options in der SQS-Konfiguration lassen sich Payloads, die das 1-MB-Limit überschreiten, optional auf einen Disk wie S3 auslagern, wobei Worker sie transparent laden.

Pull request by @Orrison

SQS has a 1 MB message size cap, and large job payloads will hit it eventually. This new opt-in feature automatically offloads payloads that exceed the limit to a configured filesystem disk - like S3 - sending a small pointer through the queue instead. Workers pick up the real payload transparently on the other side.

Add an extended_store_options block to your SQS connection config to get started:

'sqs' => [
    // ...
    'extended_store_options' => [
        'enabled' => env('SQS_STORE_ENABLED', false),
        'disk'    => env('SQS_STORE_DISK', 's3'),
        'prefix'  => env('SQS_STORE_PREFIX', ''),
        'always'  => false,
        'cleanup' => true,
    ],
],

Set always to true to route every payload through disk regardless of size. With cleanup enabled, the stored file is removed once the job processes successfully.

Originalquelle(öffnet in neuem Tab)Problem melden