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,