From e91818bc8c3e618eeaae98418e792efafc179d55 Mon Sep 17 00:00:00 2001 From: Srinath Reddy Dudi Date: Tue, 6 Jan 2026 23:17:54 -0500 Subject: [PATCH] throwing error when running sync command if laritor env variables are not added --- src/Commands/SyncCommand.php | 10 ++++++++++ src/LaritorServiceProvider.php | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Commands/SyncCommand.php b/src/Commands/SyncCommand.php index 03b2af8..103fd4f 100644 --- a/src/Commands/SyncCommand.php +++ b/src/Commands/SyncCommand.php @@ -42,6 +42,16 @@ public function handle( Laritor $laritor ) { + if (! config('laritor.keys.backend') ) { + $this->error('Laritor key is not configured. Please add the LARITOR_BACKEND_KEY env variable'); + return self::FAILURE; + } + + if (! config('laritor.ingest_endpoint') ) { + $this->error('Laritor ingest endpoint is not configured. Please add the LARITOR_INGEST_ENDPOINT env variable'); + return self::FAILURE; + } + $scheduled_tasks = $scheduledTaskHelper->getScheduledTasks();; $health_checks = $healthCheckHelper->getHealthChecks(); diff --git a/src/LaritorServiceProvider.php b/src/LaritorServiceProvider.php index d48c556..81f9bef 100755 --- a/src/LaritorServiceProvider.php +++ b/src/LaritorServiceProvider.php @@ -34,7 +34,7 @@ class LaritorServiceProvider extends ServiceProvider */ public function boot() { - if ( ! config('laritor.enabled') || !config('laritor.keys.backend') ) { + if ( ! config('laritor.enabled') ) { return; }