1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-14 01:24:05 +00:00

Merge branch '3.x' into v9-test

This commit is contained in:
Samuel Štancl 2021-12-25 16:54:03 +01:00
commit 3ab09ec83d
6 changed files with 7 additions and 7 deletions

View file

@ -55,7 +55,7 @@ class Migrate extends MigrateCommand
} }
tenancy()->runForMultiple($this->option('tenants'), function ($tenant) { tenancy()->runForMultiple($this->option('tenants'), function ($tenant) {
$this->line("Tenant: {$tenant['id']}"); $this->line("Tenant: {$tenant->getTenantKey()}");
event(new MigratingDatabase($tenant)); event(new MigratingDatabase($tenant));

View file

@ -53,7 +53,7 @@ class Rollback extends RollbackCommand
} }
tenancy()->runForMultiple($this->option('tenants'), function ($tenant) { tenancy()->runForMultiple($this->option('tenants'), function ($tenant) {
$this->line("Tenant: {$tenant['id']}"); $this->line("Tenant: {$tenant->getTenantKey()}");
event(new RollingBackDatabase($tenant)); event(new RollingBackDatabase($tenant));

View file

@ -33,7 +33,7 @@ class Run extends Command
public function handle() public function handle()
{ {
tenancy()->runForMultiple($this->option('tenants'), function ($tenant) { tenancy()->runForMultiple($this->option('tenants'), function ($tenant) {
$this->line("Tenant: {$tenant['id']}"); $this->line("Tenant: {$tenant->getTenantKey()}");
tenancy()->initialize($tenant); tenancy()->initialize($tenant);
$callback = function ($prefix = '') { $callback = function ($prefix = '') {

View file

@ -51,7 +51,7 @@ class Seed extends SeedCommand
} }
tenancy()->runForMultiple($this->option('tenants'), function ($tenant) { tenancy()->runForMultiple($this->option('tenants'), function ($tenant) {
$this->line("Tenant: {$tenant['id']}"); $this->line("Tenant: {$tenant->getTenantKey()}");
event(new SeedingDatabase($tenant)); event(new SeedingDatabase($tenant));

View file

@ -36,9 +36,9 @@ class TenantList extends Command
->cursor() ->cursor()
->each(function (Tenant $tenant) { ->each(function (Tenant $tenant) {
if ($tenant->domains) { if ($tenant->domains) {
$this->line("[Tenant] id: {$tenant['id']} @ " . implode('; ', $tenant->domains->pluck('domain')->toArray() ?? [])); $this->line("[Tenant] {$tenant->getTenantKeyName()}: {$tenant->getTenantKey()} @ " . implode('; ', $tenant->domains->pluck('domain')->toArray() ?? []));
} else { } else {
$this->line("[Tenant] id: {$tenant['id']}"); $this->line("[Tenant] {$tenant->getTenantKeyName()}: {$tenant->getTenantKey()}");
} }
}); });
} }

View file

@ -40,7 +40,7 @@ class UniversalRoutes implements Feature
} }
// Loop one level deep and check if the route's middleware // Loop one level deep and check if the route's middleware
// groups have the searhced middleware group inside them // groups have the searched middleware group inside them
$middlewareGroups = Router::getMiddlewareGroups(); $middlewareGroups = Router::getMiddlewareGroups();
foreach ($route->gatherMiddleware() as $inner) { foreach ($route->gatherMiddleware() as $inner) {
if (! $inner instanceof Closure && isset($middlewareGroups[$inner]) && in_array($middleware, $middlewareGroups[$inner], true)) { if (! $inner instanceof Closure && isset($middlewareGroups[$inner]) && in_array($middleware, $middlewareGroups[$inner], true)) {