1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 17:54:03 +00:00

Add comments for using the 'tenants' option in runForMultiple

This commit is contained in:
lukinovec 2022-08-02 08:17:30 +02:00
parent 01cd60df89
commit 0a2bbc5a16
2 changed files with 3 additions and 2 deletions

View file

@ -4,10 +4,8 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Commands;
use Illuminate\Console\Command;
use Illuminate\Foundation\Console\DownCommand;
use Stancl\Tenancy\Concerns\HasATenantsOption;
use Symfony\Component\Console\Input\InputOption;
class Down extends DownCommand
{
@ -44,6 +42,8 @@ class Down extends DownCommand
// are not available with tenants.
$payload = $this->getDownDatabasePayload();
// This runs for all tenants if no --tenants are specified
tenancy()->runForMultiple($this->option('tenants'), function ($tenant) use ($payload){
$this->line("Tenant: {$tenant['id']}");
$tenant->putDownForMaintenance($payload);

View file

@ -33,6 +33,7 @@ class Up extends Command
*/
public function handle()
{
// This runs for all tenants if no --tenants are specified
tenancy()->runForMultiple($this->option('tenants'), function ($tenant) {
$this->line("Tenant: {$tenant['id']}");
$tenant->bringUpFromMaintenance();