option("num"); $log = "num: $num"; if (!$num) { $this->error("$log, no num!"); return Command::SUCCESS; } $size = 1000; $total = 0; do { if ($num < $size) { $size = $num; } if ($total + $size > $num) { $size = $num - $total; } User::factory($size)->create(); $total += $size; $this->info("$log, success create $size !"); } while($total < $num); $this->info("$log, total: $total, ALL DONE!"); return Command::SUCCESS; } }