laravel-performance/app/Console/Commands/PrimaryKey/PrimaryKeyCommand.php

60 lines
921 B
PHP

<?php
namespace App\Console\Commands\PrimaryKey;
use App\Jobs\MassUpdate\Group1;
use App\Jobs\MassUpdate\Group2;
use App\Jobs\PrimaryKey\ProductsBigInt1Job;
use App\Jobs\PrimaryKey\ProductsUuid1Job;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Bus;
class PrimaryKeyCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'app:primary-key
{--count=100: number of rows inserted}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'mass update';
/**
* Execute the console command.
*/
public function handle()
{
$count = (int)$this->option('count');
Bus::chain([
(new ProductsBigInt1Job($count)),
(new ProductsUuid1Job($count)),
])->dispatch();
}
}