CreateQueue.php 688 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace App\Console\Commands;
  3. use Illuminate\Console\Attributes\Description;
  4. use Illuminate\Console\Attributes\Signature;
  5. use Illuminate\Console\Command;
  6. use App\Services\RabbitMQService;
  7. #[Signature('app:create-queue')]
  8. #[Description('create queues')]
  9. class CreateQueue extends Command
  10. {
  11. /**
  12. * Execute the console command.
  13. */
  14. public function handle()
  15. {
  16. //
  17. $this->info("queues create start");
  18. $created = app(RabbitMQService::class)->createQueue();
  19. $total = count($created);
  20. $this->info("[{$total}] queues created");
  21. foreach ($created as $key => $queue) {
  22. $this->line($queue);
  23. }
  24. }
  25. }