Skip to content

Commit

Permalink
Allow for callables with beforeSending (#41489)
Browse files Browse the repository at this point in the history
  • Loading branch information
driesvints committed Mar 15, 2022
1 parent a556263 commit 704c54b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Illuminate/Http/Client/PendingRequest.php
Expand Up @@ -989,11 +989,11 @@ protected function sinkStubHandler($sink)
public function runBeforeSendingCallbacks($request, array $options)
{
return tap($request, function ($request) use ($options) {
$this->beforeSendingCallbacks->each->__invoke(
(new Request($request))->withData($options['laravel_data']),
$options,
$this
);
$this->beforeSendingCallbacks->each(function ($callback) use ($request, $options) {
call_user_func(
$callback, (new Request($request))->withData($options['laravel_data']), $options, $this
);
});
});
}

Expand Down

0 comments on commit 704c54b

Please sign in to comment.