1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-15 09:24:02 +00:00

[4.x] Update commands CLI outputs (#968)

* Using laravel components

* Ensure commands returns success

* update tests

* clean

* bump EndBug version

* Update ci.yml

* Update ci.yml

* Update ci.yml

* revert CI changes

* Update ci.yml

* Update ci.yml

* Update ci.yml

* revert CI changes to it's original state

* fix typos, improve code

* improve Install & TenantList commands

* php-cs-fixer

* type GitHub properly

Co-authored-by: Abrar Ahmad <abrar.dev99@gmail.com>
Co-authored-by: Samuel Štancl <samuel@archte.ch>
Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
This commit is contained in:
Jori Stein 2022-10-18 13:11:57 -04:00 committed by GitHub
parent 05f1b2d6f5
commit e4f5b92485
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 217 additions and 96 deletions

View file

@ -22,24 +22,23 @@ class Down extends DownCommand
public function handle(): int
{
// The base down command is heavily used. Instead of saving the data inside a file,
// the data is stored the tenant database, which means some Laravel features
// are not available with tenants.
$payload = $this->getDownDatabasePayload();
// This runs for all tenants if no --tenants are specified
tenancy()->runForMultiple($this->getTenants(), function ($tenant) use ($payload) {
$this->line("Tenant: {$tenant['id']}");
$this->components->info("Tenant: {$tenant->getTenantKey()}");
$tenant->putDownForMaintenance($payload);
});
$this->comment('Tenants are now in maintenance mode.');
$this->components->info('Tenants are now in maintenance mode.');
return 0;
}
/** Get the payload to be placed in the "down" file. */
/**
* Get the payload to be placed in the "down" file. This
* payload is the same as the original function
* but without the 'template' option.
*/
protected function getDownDatabasePayload(): array
{
return [