mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-23 22:44:03 +00:00
49 lines
1.0 KiB
PHP
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);
|
|
}
|
|
}
|