Skip to content

Commit 7315c65

Browse files
committed
patch: allow for Dependency Injection and Facade
1 parent 43251f6 commit 7315c65

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/SteerApiServiceProvider.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,23 @@ class SteerApiServiceProvider extends \Illuminate\Support\ServiceProvider
66
{
77
public function register(): void
88
{
9+
// For Facade
910
$this->app->singleton('steerapi', function (\Illuminate\Contracts\Foundation\Application $app) {
1011
return new SteerConnector(
1112
config('steer.api_key'),
1213
config('steer.sub_id'),
1314
config('steer.base_url')
1415
);
1516
});
17+
18+
// For Dependency Injection
19+
$this->app->singleton(SteerConnector::class, function (\Illuminate\Contracts\Foundation\Application $app) {
20+
return new SteerConnector(
21+
config('steer.api_key'),
22+
config('steer.sub_id'),
23+
config('steer.base_url')
24+
);
25+
});
1626
}
1727

1828
public function boot(): void

0 commit comments

Comments
 (0)