From c3fa352adb54697adae9ede1e1f95e40d017f25c Mon Sep 17 00:00:00 2001 From: Thorsten Bus Date: Mon, 2 Mar 2026 12:03:52 +0100 Subject: [PATCH] feat(sync): add hourly CTS sync schedule --- app/Http/Controllers/ServiceController.php | 1 + bootstrap/app.php | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/app/Http/Controllers/ServiceController.php b/app/Http/Controllers/ServiceController.php index e84a7ef..8baf0af 100644 --- a/app/Http/Controllers/ServiceController.php +++ b/app/Http/Controllers/ServiceController.php @@ -51,6 +51,7 @@ public function index(): Response ->get() ->map(fn (Service $service) => [ 'id' => $service->id, + 'cts_event_id' => $service->cts_event_id, 'title' => $service->title, 'date' => $service->date?->toDateString(), 'preacher_name' => $service->preacher_name, diff --git a/bootstrap/app.php b/bootstrap/app.php index 007d534..21c82ae 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -3,6 +3,7 @@ use Illuminate\Foundation\Application; use Illuminate\Foundation\Configuration\Exceptions; use Illuminate\Foundation\Configuration\Middleware; +use Illuminate\Console\Scheduling\Schedule; return Application::configure(basePath: dirname(__DIR__)) ->withRouting( @@ -14,6 +15,9 @@ ->withCommands([ __DIR__.'/../app/Console/Commands', ]) + ->withSchedule(function (Schedule $schedule): void { + $schedule->command('cts:sync')->hourly(); + }) ->withMiddleware(function (Middleware $middleware): void { $middleware->web(append: [ \App\Http\Middleware\HandleInertiaRequests::class,