Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

Melcus/parking-system

10 stars
1 code files
View Melcus/parking-system on GitHub

app/Console/Commands/CleanExpiredReservations.php

Open in GitHub
use 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();
}
}

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.