58 lines
909 B
PHP
58 lines
909 B
PHP
<?php
|
|
|
|
namespace App\Console\Commands\Mass;
|
|
|
|
use App\Jobs\MassDelete;
|
|
use Illuminate\Console\Command;
|
|
use Illuminate\Support\Facades\Bus;
|
|
|
|
class MassDeleteCommand extends Command
|
|
{
|
|
/**
|
|
* The name and signature of the console command.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $signature = 'app:mass-delete
|
|
{--count=100: number of rows inserted}';
|
|
|
|
/**
|
|
* The console command description.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $description = 'mass insert';
|
|
|
|
/**
|
|
* Execute the console command.
|
|
*/
|
|
public function handle(): void
|
|
{
|
|
$count = (int)$this->option('count');
|
|
|
|
Bus::chain([
|
|
(new \App\Jobs\Mass\MassDelete\MassDelete1Job($count)),
|
|
(new \App\Jobs\Mass\MassDelete\MassDelete2Job($count)),
|
|
(new \App\Jobs\Mass\MassDelete\MassDelete3Job($count)),
|
|
])->dispatch();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|