3 namespace App\Console\Commands;
5 use App\Models\Channel;
6 use Illuminate\Console\Command;
7 use Illuminate\Http\Client\RequestException;
8 use Illuminate\Support\Facades\Http;
10 class GuessingClean extends Command {
13 * The name and signature of the console command.
17 protected $signature = 'guessing:clean';
20 * The console command description.
24 protected $description = 'Cancel orphaned guessing games';
27 * Execute the console command.
31 public function handle()
34 ::whereNotNull('guessing_start')
35 ->where('guessing_start', '<', now()
38 foreach ($channels as $channel) {
39 $this->line($channel->title);
40 $channel->guessing_start = null;
41 $channel->guessing_end = null;
44 return Command::SUCCESS;