- routes/console.php에 스케줄러 마이그레이션 (Laravel 12 표준) - appendOutputTo로 실행 결과 로그 기록 (storage/logs/scheduler.log) - onSuccess/onFailure로 성공/실패 이벤트 로그 (storage/logs/laravel.log) - app/Console/Kernel.php schedule() 메서드 정리 - CURRENT_WORKS.md 업데이트
33 lines
951 B
PHP
33 lines
951 B
PHP
<?php
|
|
|
|
namespace App\Console;
|
|
|
|
use App\Console\Commands\GenerateSimpleRelationships;
|
|
use App\Console\Commands\MakeModelWithRelationships;
|
|
use App\Console\Commands\PruneAuditLogs;
|
|
use App\Console\Commands\UpdateLogicalRelationships;
|
|
use Illuminate\Console\Scheduling\Schedule;
|
|
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
|
|
|
class Kernel extends ConsoleKernel
|
|
{
|
|
protected $commands = [
|
|
PruneAuditLogs::class,
|
|
UpdateLogicalRelationships::class,
|
|
MakeModelWithRelationships::class,
|
|
GenerateSimpleRelationships::class,
|
|
];
|
|
|
|
protected function schedule(Schedule $schedule): void
|
|
{
|
|
// Laravel 12부터는 routes/console.php에서 스케줄러를 정의합니다.
|
|
// Schedule::command() 방식 사용
|
|
}
|
|
|
|
protected function commands(): void
|
|
{
|
|
// 라우트 콘솔 혹은 커맨드 자동 로딩 필요 시 사용
|
|
// $this->load(__DIR__.'/Commands');
|
|
}
|
|
}
|