Skip to content

Conversation

@cosmastech
Copy link
Contributor

This adds convenience for folks who want to create a new request without having to name it.

function addPromiseMapping($promise) {
    $promise->get('https://laravel.com/careers')
        ->then(fn ($response) => str_contains($response->body(), 'software engineer'));
}

Http::pool(function (Pool $pool) {
    addPromiseMapping($pool->newRequest());
    addPromiseMapping($pool->newRequest());
});

Prior to this, you would have to name the request (via Pool@as()) even if that wasn't convenient for the use case.

@taylorotwell taylorotwell merged commit 40506d8 into laravel:12.x Dec 6, 2025
76 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants