From 5fd0b00da0ed98de31a0395797db571dc6849e4e Mon Sep 17 00:00:00 2001 From: Arjan Weurding Date: Mon, 9 Nov 2020 13:40:29 +0100 Subject: [PATCH] Make the factory Injectable DI support by using the class name --- src/FeedsServiceProvider.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/FeedsServiceProvider.php b/src/FeedsServiceProvider.php index 6c3237f..35f1936 100644 --- a/src/FeedsServiceProvider.php +++ b/src/FeedsServiceProvider.php @@ -30,7 +30,7 @@ public function boot() */ public function register() { - $this->app->singleton('Feeds', function () { + $this->app->singleton(FeedsFactory::class, function () { $config = config('feeds'); if (! $config) { @@ -39,6 +39,7 @@ public function register() return new FeedsFactory($config); }); + $this->app->alias(FeedsFactory::class, 'Feeds'); } /**