33namespace Honeybadger \HoneybadgerLaravel ;
44
55use GuzzleHttp \Client ;
6+ use Honeybadger \CheckinsManager ;
7+ use Honeybadger \Contracts \SyncCheckins ;
8+ use Honeybadger \HoneybadgerLaravel \Commands \HoneybadgerCheckinsSyncCommand ;
69use Honeybadger \LogHandler ;
710use Honeybadger \Honeybadger ;
811use Honeybadger \Contracts \Reporter ;
1417use Honeybadger \HoneybadgerLaravel \Contracts \Installer as InstallerContract ;
1518use Illuminate \Console \Scheduling \Event ;
1619use Illuminate \Support \Facades \Blade ;
20+ use Illuminate \Support \Facades \Log ;
1721use Illuminate \Support \ServiceProvider ;
1822
1923class HoneybadgerServiceProvider extends ServiceProvider
@@ -46,6 +50,7 @@ public function register()
4650 $ this ->mergeConfigFrom (__DIR__ .'/../config/honeybadger.php ' , 'honeybadger ' );
4751
4852 $ this ->registerReporters ();
53+ $ this ->registerCheckinsSync ();
4954
5055 $ this ->app ->bind (LogHandler::class, function ($ app ) {
5156 return new LogHandler ($ app [Reporter::class]);
@@ -72,6 +77,7 @@ private function registerCommands()
7277 $ this ->commands ([
7378 'command.honeybadger:test ' ,
7479 'command.honeybadger:checkin ' ,
80+ 'command.honeybadger:checkins:sync ' ,
7581 'command.honeybadger:install ' ,
7682 'command.honeybadger:deploy ' ,
7783 ]);
@@ -92,6 +98,11 @@ private function bindCommands()
9298 HoneybadgerCheckinCommand::class
9399 );
94100
101+ $ this ->app ->bind (
102+ 'command.honeybadger:checkins:sync ' ,
103+ HoneybadgerCheckinsSyncCommand::class
104+ );
105+
95106 $ this ->app ->bind (
96107 'command.honeybadger:install ' ,
97108 HoneybadgerInstallCommand::class
@@ -174,6 +185,13 @@ protected function setUpAutomaticBreadcrumbs()
174185 }
175186 }
176187
188+ protected function registerCheckinsSync (): void
189+ {
190+ $ this ->app ->singleton (SyncCheckins::class, function ($ app ) {
191+ return new CheckinsManager ($ app ['config ' ]['honeybadger ' ]);
192+ });
193+ }
194+
177195 protected function registerReporters (): void
178196 {
179197 $ this ->app ->singleton (Reporter::class, function ($ app ) {
0 commit comments