1<?php
2
3// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0.
4// See the LICENCE file in the repository root for full licence text.
5
6namespace App\Console\Commands;
7
8use App\Models\Store\Order;
9use Illuminate\Console\Command;
10
11class StoreCleanupStaleOrders extends Command
12{
13 protected $signature = 'store:cleanup-stale-orders';
14
15 protected $description = 'Removes stale orders';
16
17 public function handle()
18 {
19 $count = Order::paymentRequested()->stale()->update(['status' => Order::STATUS_CANCELLED]);
20
21 $this->line("Cancelled {$count} stale orders.");
22 }
23}