Files
exchange-2.0/app/Console/Commands/RemoveSeasonalSegmentCompany.php
T
edmondlang 7cf7fdec54 honey trap
2023-03-17 18:40:48 +08:00

49 lines
1.0 KiB
PHP

<?php
namespace App\Console\Commands;
use App\Models\SeasonalSegment;
use Illuminate\Console\Command;
use Carbon\Carbon;
class RemoveSeasonalSegmentCompany extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'seasonalSegmantCompany:remove';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Command description';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
$count = SeasonalSegment::where('ending_on', '<=', Carbon::today())->count();
SeasonalSegment::where('ending_on', '<=', Carbon::today())->delete();
$this->info(Carbon::now() . ' : Done soft delete on seasonal segment company. Total Deleted: ' . $count);
}
}