ldc-legaulois/app/Jobs/DeleteOrders.php

33 lines
671 B
PHP
Raw Normal View History

<?php
namespace App\Jobs;
use App\Models\Order;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Log;
class DeleteOrders implements ShouldQueue
{
use Dispatchable;
use InteractsWithQueue;
use Queueable;
use SerializesModels;
/**
* Execute the job.
*
* @return void
*/
public function handle()
{
Log::debug(sprintf(
'Deleted %d old failed orders',
Order::outdatedFailedOrders()->delete()
));
}
}