feat(sync): add hourly CTS sync schedule
This commit is contained in:
parent
951ed81e47
commit
c3fa352adb
|
|
@ -51,6 +51,7 @@ public function index(): Response
|
||||||
->get()
|
->get()
|
||||||
->map(fn (Service $service) => [
|
->map(fn (Service $service) => [
|
||||||
'id' => $service->id,
|
'id' => $service->id,
|
||||||
|
'cts_event_id' => $service->cts_event_id,
|
||||||
'title' => $service->title,
|
'title' => $service->title,
|
||||||
'date' => $service->date?->toDateString(),
|
'date' => $service->date?->toDateString(),
|
||||||
'preacher_name' => $service->preacher_name,
|
'preacher_name' => $service->preacher_name,
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
use Illuminate\Foundation\Application;
|
use Illuminate\Foundation\Application;
|
||||||
use Illuminate\Foundation\Configuration\Exceptions;
|
use Illuminate\Foundation\Configuration\Exceptions;
|
||||||
use Illuminate\Foundation\Configuration\Middleware;
|
use Illuminate\Foundation\Configuration\Middleware;
|
||||||
|
use Illuminate\Console\Scheduling\Schedule;
|
||||||
|
|
||||||
return Application::configure(basePath: dirname(__DIR__))
|
return Application::configure(basePath: dirname(__DIR__))
|
||||||
->withRouting(
|
->withRouting(
|
||||||
|
|
@ -14,6 +15,9 @@
|
||||||
->withCommands([
|
->withCommands([
|
||||||
__DIR__.'/../app/Console/Commands',
|
__DIR__.'/../app/Console/Commands',
|
||||||
])
|
])
|
||||||
|
->withSchedule(function (Schedule $schedule): void {
|
||||||
|
$schedule->command('cts:sync')->hourly();
|
||||||
|
})
|
||||||
->withMiddleware(function (Middleware $middleware): void {
|
->withMiddleware(function (Middleware $middleware): void {
|
||||||
$middleware->web(append: [
|
$middleware->web(append: [
|
||||||
\App\Http\Middleware\HandleInertiaRequests::class,
|
\App\Http\Middleware\HandleInertiaRequests::class,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue