From db9113007ab2c83e23e5fb11d211eed244365ed0 Mon Sep 17 00:00:00 2001 From: "j.stein" Date: Thu, 2 Dec 2021 23:35:30 +0100 Subject: [PATCH] Add up and down tenant maintenance commands --- src/Commands/Down.php | 52 +++++++++++++++++++++++++++++++++++++++++++ src/Commands/Up.php | 43 +++++++++++++++++++++++++++++++++++ 2 files changed, 95 insertions(+) create mode 100644 src/Commands/Down.php create mode 100644 src/Commands/Up.php diff --git a/src/Commands/Down.php b/src/Commands/Down.php new file mode 100644 index 00000000..ec21a340 --- /dev/null +++ b/src/Commands/Down.php @@ -0,0 +1,52 @@ +runForMultiple($this->option('tenants'), function ($tenant) { + $this->line("Tenant: {$tenant['id']}"); + $tenant->putDownForMaintenance([ + 'time' => $this->option('time'), + 'message' => $this->option('message'), + 'retry' => $this->option('retry'), + 'allowed' => $this->option('allowed'), + ]); + }); + + $this->comment('Tenants are now in maintenance mode.'); + } +} diff --git a/src/Commands/Up.php b/src/Commands/Up.php new file mode 100644 index 00000000..c47bdb7f --- /dev/null +++ b/src/Commands/Up.php @@ -0,0 +1,43 @@ +runForMultiple($this->option('tenants'), function ($tenant) { + $this->line("Tenant: {$tenant['id']}"); + $tenant->bringUpFromMaintenance(); + }); + + $this->comment('Tenants are now out of maintenance mode.'); + } +}