領収証発行サービス
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

61 lines
1.1KB

  1. <?php
  2. namespace App\Console\Commands;
  3. class HeartBeat extends BaseCommand
  4. {
  5. const COMMAND = "heartbeat {--maintenance}";
  6. protected bool $outputInfoForBase = false;
  7. /**
  8. * The name and signature of the console command.
  9. *
  10. * @var string
  11. */
  12. protected $signature = self::COMMAND;
  13. /**
  14. * The console command description.
  15. *
  16. * @var string
  17. */
  18. protected $description = 'ハートビート';
  19. static public function getCommand()
  20. {
  21. return self::COMMAND;
  22. }
  23. /**
  24. * Create a new command instance.
  25. *
  26. * @return void
  27. */
  28. public function __construct()
  29. {
  30. parent::__construct();
  31. }
  32. /**
  33. * Execute the console command.
  34. *
  35. * @return int
  36. */
  37. public function service(): int
  38. {
  39. if ($this->option('maintenance')) {
  40. $isMaintenanceMode = app()->isDownForMaintenance();
  41. if ($isMaintenanceMode) {
  42. $this->outputWarn("down for maintenance");
  43. }
  44. } else {
  45. $this->outputInfo("heart beat");
  46. }
  47. return self::RESULTCODE_SUCCESS;
  48. }
  49. }