diff --git a/composer.json b/composer.json index 2e53ad1..eec9136 100644 --- a/composer.json +++ b/composer.json @@ -46,6 +46,7 @@ "extra": { "laravel": { "providers": [ + "Inboxly\\Receiver\\FeedIoServiceProvider", "Inboxly\\Receiver\\ReceiverServiceProvider" ] } diff --git a/src/FeedIoServiceProvider.php b/src/FeedIoServiceProvider.php new file mode 100644 index 0000000..37b7f8f --- /dev/null +++ b/src/FeedIoServiceProvider.php @@ -0,0 +1,37 @@ +app->bind(ClientInterface::class, Client::class); + } + + /** + * Bootstrap services. + * + * @return void + * @throws \Illuminate\Contracts\Container\BindingResolutionException + */ + public function boot() + { + $guzzle = $this->app->make(ClientInterface::class); + $feedIo = new FeedIo(new ClientAdapter($guzzle), new NullLogger()); + + $this->app->instance(FeedIo::class, $feedIo); + } +}