Skip to content

Bind GuzzleHttpClient as default client for Unleash. #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

robertatcd
Copy link
Contributor

#16 (comment)

(Finally :) )

From the suggestion by https://github.com/gsmofgsm in that thread.

This update provides GuzzleHttp\ClientInterface as the default client for Unleash.

In particular, it allows the use of the Facade without having to first bind Guzzle into the service container.

@@ -15,9 +18,9 @@ class ServiceProvider extends IlluminateServiceProvider
public function register()
{
$this->mergeConfigFrom($this->getConfigPath(), 'unleash');
$this->app ->when(Unleash::class)->needs(ClientInterface::class)->give(Client::class);
Copy link
Collaborator

@mxkxf mxkxf Apr 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There looks to be a rogue space after app, is this needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sharp eyes! I have pushed an update.

Copy link
Collaborator

@mxkxf mxkxf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks @robertatcd!

@mxkxf mxkxf merged commit a31289f into laravel-unleash:master Apr 8, 2021
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