<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use App\Models\Draw;
use Carbon\Carbon;

class CheckDrawDateExpired extends Command
{
    protected $signature = 'draw:check-expired';

    protected $description = 'Check for expired draw dates';

    public function handle()
    {
        $expiredDraws = Draw::where('draw_date', '<', Carbon::now())->get();

        foreach ($expiredDraws as $draw) {
            // Perform actions for expired draw
            // For example, notify winners or update draw status
            // You can add your custom logic here
        }
    }
}
