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 12.x: --readable-Flag für env:encrypt

Der Befehl php artisan env:encrypt hat das neue Flag --readable, das Schlüsselnamen in der verschlüsselten Ausgabe sichtbar lässt und nur die Werte schützt.

Pull request by @mathiasgrimm

A practical quality-of-life improvement: --readable makes encrypted env output easier to audit by keeping key names visible, which helps during reviews and incident response while still protecting secret values. If you're hardening deployments, this pairs nicely with Laravel's environment encryption workflow.

php artisan env:encrypt --readable

Originalquelle(öffnet in neuem Tab)Problem melden

Laravel Framework von Laravel

Laravel 12.x: Callbacks nach dem Erstellen einer HTTP-Response

Der HTTP Client erhält die neue Methode afterResponse, mit der sich die Response eines HTTP-Aufrufs prüfen und verändern lässt.

Pull request by @cosmastech

A new afterResponse method was added to the HTTP Client, which allows the user to inspect and mutate the response returned from an HTTP call:

Http::acceptJson()
    ->withHeader('X-Shopify-Access-Token', $credentials->token)
    ->baseUrl("https://{$credentials->shop_domain}.myshopify.com/admin/api/2025-10/")
    ->afterResponse(
        // Report any deprecation notices that were in the header
        function (Response $response) use ($credentials) {
            if ($header = $response->header('X-Shopify-API-Deprecated-Reason')) {
                event(new ShopifyDeprecationNotice($credentials->shop, $header));
            }
        })
    ->afterResponse(
        // Map the response into our own custom response class
        fn (Response $response) => new ShopifyResponse($response->toPsrResponse()),
    )
    ->afterResponse(
        // Report the cost of the query
        static fn (ShopifyResponse $response) => QueryCostResponse::report(
            $response->getQueryCost(),
            $credentials->shop
        ),
    );

Originalquelle(öffnet in neuem Tab)Problem melden

Laravel Framework von Laravel

Laravel 12.x: FluentPromise für sauberes Chaining in Http::pool

Mit der Einführung von FluentPromise lässt sich in Http::pool nun eigenes Chaining nutzen, sodass beliebige Werte statt der ursprünglichen Response zurückgegeben werden können.

Pull request by @cosmastech

Userland chaining in Http::pool is now possible with the introduction of FluentPromise. Previously, the chain would return the original response, limiting flexibility. With this change, users can access the underlying array and return whatever they wish:

$response = Http::pool(function (Pool $pool) {
    $pool->as('cosmatech')
        ->get('https://cosmastech.com')
        ->then(
            fn ($response) => strlen($response->body())
        );
    $pool->as('laravel')
        ->get('https://laravel.com')
        ->then(
            fn ($response) => strlen($response->body())
        );
});

/*
array:2 [
  "cosmatech" => 9095
  "laravel" => 1422023
]
*/

Originalquelle(öffnet in neuem Tab)Problem melden

Laravel Framework von Laravel

Laravel 12.x: Neue Helfer lazy und proxy für Lazy Objects

Zwei neue Helfer, lazy und proxy, machen die Nutzung der neuen Lazy Objects von PHP komfortabler.

Pull request by @timacdonald

Two new helpers, lazy and proxy, were added to make PHP's new lazy objects more ergonomic to use.

<?php

use Illuminate\Support\Facades\Http;
use Vendor\Facades\ResultFactory;
use Vendor\Result;
use function Illuminate\Support\lazy;
use function Illuminate\Support\proxy;

$response = Http::get(...);

$instance = lazy(Result::class, fn () => [$response->json()]);
$instance = proxy(Result::class, fn (): Result => ResultFactory::make($response->json()));

Originalquelle(öffnet in neuem Tab)Problem melden

Laravel Framework von Laravel

Laravel 12.x: Neuer Befehl php artisan reload

Der neue Befehl php artisan reload erlaubt es Service Providern, eigene Reload-Befehle zu registrieren, die nach dem Deployment ausgeführt werden können, und ist bereits für Horizon, Pulse, Reverb und Octane umgesetzt.

Pull request by @barryvdh

A new php artisan reload command was introduced, allowing service providers to add their own commands for reloading. This makes it easier for services to specify one command to include in their deployment steps after the deployment is completed.

The applicable reload commands have already been added to Laravel Horizon, Pulse, Reverb, and Octane.

public function boot()
{
    $this->reloads('reverb:restart');
}

Originalquelle(öffnet in neuem Tab)Problem melden

Laravel Framework von Laravel

Laravel 12.x: FluentPromise für Http::pool

Mit der neuen FluentPromise lassen sich Aufrufe in Http::pool verketten und beliebige eigene Rückgabewerte statt der ursprünglichen Response erzeugen.

Pull request by @cosmastech

Userland chaining in Http::pool is now possible with the introduction of FluentPromise. Previously, the chain would return the original response, limiting flexibility. With this change, users can access the underlying array and return whatever they wish:

$response = Http::pool(function (Pool $pool) {
    $pool->as('cosmatech')
        ->get('https://cosmastech.com')
        ->then(
            fn ($response) => strlen($response->body())
        );
    $pool->as('laravel')
        ->get('https://laravel.com')
        ->then(
            fn ($response) => strlen($response->body())
        );
});

/*
array:2 [
  "cosmatech" => 9095
  "laravel" => 1422023
]
*/

Originalquelle(öffnet in neuem Tab)Problem melden

Laravel Framework von Laravel

Neue Helfer lazy und proxy für PHP Lazy Objects

Laravel Framework 12.x erhält die zwei neuen Helfer lazy und proxy, die die Nutzung von PHPs neuen Lazy Objects komfortabler machen.

Pull request by @timacdonald

Two new helpers, lazy and proxy, were added to make PHP's new lazy objects more ergonomic to use.

<?php

use Illuminate\Support\Facades\Http;
use Vendor\Facades\ResultFactory;
use Vendor\Result;
use function Illuminate\Support\lazy;
use function Illuminate\Support\proxy;

$response = Http::get(...);

$instance = lazy(Result::class, fn () => [$response->json()]);
$instance = proxy(Result::class, fn (): Result => ResultFactory::make($response->json()));

Originalquelle(öffnet in neuem Tab)Problem melden

Laravel Framework von Laravel

Laravel 12.x: Neue Methode daysOfMonth() für den Scheduler

Die neue Methode daysOfMonth() erlaubt es, Aufgaben an mehreren bestimmten Tagen des Monats auszuführen, etwa am 1. und 15.

Pull request by @yousefkadah

Previously, there wasn't a way to schedule tasks on multiple arbitrary days of the month (e.g., 1st, 10th). A daysOfMonth() method was added that allows scheduling tasks to run on multiple specific days of the month with a clean, intuitive API.

$schedule->command('process-payroll')
    ->daysOfMonth(1, 15) // 1st and 15th of each month
    ->timezone('America/New_York');

Originalquelle(öffnet in neuem Tab)Problem melden

Laravel Framework von Laravel

Neue Validierungsregel encoding für hochgeladene Dateien

Die neue Validierungsregel encoding prüft per mb_check_encoding(), ob der Inhalt einer Datei oder eines Strings zu einer bestimmten Kodierung passt.

Pull request by @ziadoz

A new encoding validation rule was added that checks the contents of a file or string matches a specific encoding using mb_check_encoding(), ensuring that uploaded files are encoded as expected before processing.

Validator::validate($input, [
    'attachment' => [
        'required',
        File::types(['csv'])->encoding('utf-8'),
    ],
]);

Originalquelle(öffnet in neuem Tab)Problem melden

Laravel Framework von Laravel

Neue Interval-Helper-Funktionen in Laravel 12.x

Neue Interval-Helper-Funktionen wie minutes() und now()->plus(hours: 6) erlauben es, die aktuelle Zeit fließend anzupassen.

Pull request by @taylorotwell

New interval helper functions were added for fluently getting the current time with adjustments:

use Illuminate\Support\{ now, minutes }

Cache::put('name', 'Taylor', minutes(5));

Invitation::create([
    'expires_at' => now()->plus(hours: 6),
]);

Originalquelle(öffnet in neuem Tab)Problem melden

Laravel Framework von Laravel

Queue-Worker pausieren und fortsetzen

Mit den neuen Artisan-Befehlen queue:pause und queue:continue lässt sich ein Queue-Worker vorübergehend anhalten, ohne ihn zu beenden.

Pull request by @yousefkadah

Sometimes you may need to temporarily prevent a queue worker from processing new jobs without stopping the worker entirely. Now you can with newly added artisan commands:

php artisan queue:pause database:default
php artisan queue:continue database:default

Originalquelle(öffnet in neuem Tab)Problem melden

Laravel Framework von Laravel

Neue Blade-Direktive @hasStack

Die neue Direktive @hasStack ermöglicht es, Markup um einen @stack nur dann auszugeben, wenn der Stack nicht leer ist.

Pull request by @browner12

The new @hasStack directive can be used to wrap @stack directives for conditional output depending on if the stack is empty or not. This is useful if you want some markup to wrap the stack only if it is not empty.

@hasStack("list")
<ul>
    @stack("list")
</ul>
@endif

Originalquelle(öffnet in neuem Tab)Problem melden

Laravel Framework von Laravel

route:list mit neuem --middleware-Filter

Der Befehl route:list besitzt jetzt die Option --middleware, mit der sich die Ausgabe nach einer Middleware-Klasse oder Middleware-Gruppe filtern lässt.

Pull request by @jasonmccreary

A --middleware option was added to the route:list command to filter output by middleware. This can be a single middleware class name or a middleware group name, allowing you to easily see routes with the specified middleware applied.

php artisan route:list --middleware=api
php artisan route:list --middleware=ThrottleRequests

Originalquelle(öffnet in neuem Tab)Problem melden

Laravel Framework von Laravel

Neuer Testing-Trait WithCachedRoutes

Der neue Testing-Trait WithCachedRoutes speichert die Routen beim Test-Setup statisch in einem Testing\CachedState-Objekt, sodass folgende Tests sie nicht erneut von der Festplatte lesen müssen.

Pull request by @cosmastech

A new testing trait called WithCachedRoutes was introduced. This testing trait stores the routes as a static property within a Testing\CachedState object during test setup, ensuring subsequent tests do not need to read from disk.

Originalquelle(öffnet in neuem Tab)Problem melden

Laravel Framework von Laravel

Neue Methode Factory@insert() für Eloquent Factories

Eloquent Factories bieten nun die Methode insert() für Masseneinfügungen von Models, was Tests mit vielen Datensätzen beschleunigt.

Pull request by @cosmastech

The insert() method was added to Eloquent Factories, allowing you to perform a mass insert of models. This increases performance during testing with numerous of database records.

Originalquelle(öffnet in neuem Tab)Problem melden

Laravel Framework von Laravel

ucwords für Str und Stringable sowie PHP-8.5-Kompatibilität

Stringable erhält die Methode ucwords, die im Gegensatz zu title den Rest des Strings unverändert lässt, und mehrere Pakete wurden für die Kompatibilität mit PHP 8.5 aktualisiert.

Pull request by @braxey

A ucwords method was added to Stringable, allowing fluent uppercasing of the first letter of a string. Note that this differs from title in that the rest of the string remains untouched.

// Taylor Otwell, Creator Of Laravel
$name = $this->string('taylor otwell, creator of laravel')->ucwords();

A number of packages were updated to ensure they maintained compatibility with the newly released PHP 8.5, including:

Originalquelle(öffnet in neuem Tab)Problem melden

Laravel Framework von Laravel

Neue Methode daysOfMonth() für geplante Tasks

Mit der neuen Methode daysOfMonth() lassen sich Tasks an mehreren bestimmten Tagen eines Monats ausführen, etwa am 1. und 15.

Pull request by @yousefkadah

Previously, there wasn't a way to schedule tasks on multiple arbitrary days of the month (e.g., 1st, 10th). A daysOfMonth() method was added that allows scheduling tasks to run on multiple specific days of the month with a clean, intuitive API.

$schedule->command('process-payroll')
    ->daysOfMonth(1, 15) // 1st and 15th of each month
    ->timezone('America/New_York');

Originalquelle(öffnet in neuem Tab)Problem melden

Laravel Framework von Laravel

Neue Validierungsregel encoding für hochgeladene Dateien

Die neue Validierungsregel encoding prüft mit mb_check_encoding(), ob der Inhalt einer Datei oder eines Strings der erwarteten Kodierung entspricht.

Pull request by @ziadoz

A new encoding validation rule was added that checks the contents of a file or string matches a specific encoding using mb_check_encoding(), ensuring that uploaded files are encoded as expected before processing.

Validator::validate($input, [
    'attachment' => [
        'required',
        File::types(['csv'])->encoding('utf-8'),
    ],
]);

Originalquelle(öffnet in neuem Tab)Problem melden

Laravel Framework von Laravel

Neue Blade-Direktive @hasStack

Die neue Direktive @hasStack umschließt @stack-Direktiven und gibt Markup nur aus, wenn der Stack nicht leer ist.

Pull request by @browner12

The new @hasStack directive can be used to wrap @stack directives for conditional output depending on if the stack is empty or not. This is useful if you want some markup to wrap the stack only if it is not empty.

@hasStack("list")
<ul>
    @stack("list")
</ul>
@endif

Originalquelle(öffnet in neuem Tab)Problem melden

Laravel Framework von Laravel

route:list erhält Filter --middleware

Der Befehl route:list besitzt jetzt die Option --middleware, mit der sich die Ausgabe nach einer Middleware-Klasse oder Middleware-Gruppe filtern lässt.

Pull request by @jasonmccreary

A --middleware option was added to the route:list command to filter output by middleware. This can be a single middleware class name or a middleware group name, allowing you to easily see routes with the specified middleware applied.

php artisan route:list --middleware=api
php artisan route:list --middleware=ThrottleRequests

Originalquelle(öffnet in neuem Tab)Problem melden