layer-chicken/routes/console.php

17 lines
435 B
PHP

<?php
use App\Models\FeedSchedule;
use Illuminate\Support\Facades\Schedule;
use Illuminate\Support\Facades\Schema;
if (Schema::hasTable('feed_schedules')) {
$times = FeedSchedule::query()
->distinct()
->pluck('scheduled_at');
foreach ($times as $time) {
$formattedTime = date('H:i', strtotime($time));
Schedule::command('feed:schedule-process', [$formattedTime])->at($formattedTime);
}
}