Skip to content

Commit

Permalink
Only set base uri if specified
Browse files Browse the repository at this point in the history
This allows you to set the base uri inside a custom binding.
  • Loading branch information
JaZo committed Oct 28, 2020
1 parent 97600c0 commit c99d17d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Providers/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ protected function registerClients()
$this->app->extend(
ClientInterface::class,
static function (ClientInterface $client) {
$client->setBaseUri(config('jsonapi.base_uri'));
if ($baseUri = config('jsonapi.base_uri')) {
$client->setBaseUri($baseUri);
}

return $client;
}
Expand Down

0 comments on commit c99d17d

Please sign in to comment.