Skip to content

Commit

Permalink
Fix backwards compatibility for Laravel 10
Browse files Browse the repository at this point in the history
  • Loading branch information
likeadeckofcards committed Jun 5, 2024
1 parent 5199e7c commit 9c7fae8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Services/FileMakerConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use GearboxSolutions\EloquentFileMaker\Exceptions\FileMakerDataApiException;
use Illuminate\Database\Connection;
use Illuminate\Database\Events\QueryExecuted;
use Illuminate\Http\Client\Factory;
use Illuminate\Http\Client\PendingRequest;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Arr;
Expand Down Expand Up @@ -693,7 +694,11 @@ public function setGlobalFields(array $globalFields)
protected function prepareRequestForSending($request = null)
{
if (! $request) {
$request = Http::createPendingRequest();
if (method_exists(Factory::class, 'createPendingRequest')) {
$request = Http::createPendingRequest();
} else {
$request = new PendingRequest();
}
}

$request->retry($this->attempts, 100, fn () => true, false)->withToken($this->sessionToken);
Expand Down

0 comments on commit 9c7fae8

Please sign in to comment.