-
app/Console/Commands/CleanExpiredReservations.php
Open in GitHubuse App\Models\Reservation; use Illuminate\Console\Command; class CleanExpiredReservations extends Command { protected $signature = 'clean:expired:reservations'; protected $description = 'Command description'; public function __construct() { parent::__construct(); } public function handle() { Reservation::query() ->whereNull('paid_at') ->where('created_at', '<', now()->addMinutes(10)) ->delete(); } }