Skip to content

Commit

Permalink
bidnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ExpDev07 committed Mar 25, 2022
1 parent 5be9fa6 commit 2fd8835
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
6 changes: 4 additions & 2 deletions src/Logsnag.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ class Logsnag

/**
* Constructs a new Logsnag.
*
* @param LogsnagClient $client
*/
public function __construct()
public function __construct(LogsnagClient $client)
{
$this->client = app(LogsnagClient::class);
$this->client = $client;
}

/**
Expand Down
11 changes: 5 additions & 6 deletions src/LogsnagServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,12 @@ public function configurePackage(Package $package): void
*/
protected function registerContainerBindings(): void
{
// Bind the Logsnag client.
$this->app->instance(LogsnagClient::class, new LogsnagClient(
token: config('logsnag.token', ''),
));
// Create client.
$client = new LogsnagClient(config('logsnag.token', ''));

// Bind the Logsnag.
$this->app->instance(Logsnag::class, new Logsnag());
// Bind to container.
$this->app->instance(Logsnag::class, new Logsnag($client));
$this->app->instance(LogsnagClient::class, $client);
}

}

0 comments on commit 2fd8835

Please sign in to comment.