Skip to content

Commit 704c54b

Browse files
authored
Allow for callables with beforeSending (#41489)
1 parent a556263 commit 704c54b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Illuminate/Http/Client/PendingRequest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -989,11 +989,11 @@ protected function sinkStubHandler($sink)
989989
public function runBeforeSendingCallbacks($request, array $options)
990990
{
991991
return tap($request, function ($request) use ($options) {
992-
$this->beforeSendingCallbacks->each->__invoke(
993-
(new Request($request))->withData($options['laravel_data']),
994-
$options,
995-
$this
996-
);
992+
$this->beforeSendingCallbacks->each(function ($callback) use ($request, $options) {
993+
call_user_func(
994+
$callback, (new Request($request))->withData($options['laravel_data']), $options, $this
995+
);
996+
});
997997
});
998998
}
999999

0 commit comments

Comments
 (0)