1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 08:44:04 +00:00

Use nullsafe operator

This commit is contained in:
Mark 2024-12-29 09:15:13 +01:00
parent c1679e6057
commit 44d6509691
No known key found for this signature in database
GPG key ID: 79CFF7869BD39873
2 changed files with 2 additions and 2 deletions

View file

@ -128,7 +128,7 @@ class QueueTenancyBootstrapper implements TenancyBootstrapper
}
// Revert back to the previous tenant
if (tenant() && $previousTenant && $previousTenant->isNot(tenant())) {
if (tenant() && $previousTenant?->isNot(tenant())) {
tenancy()->initialize($previousTenant);
}

View file

@ -30,7 +30,7 @@ if (! function_exists('tenant')) {
return app(Tenant::class);
}
return optional(app(Tenant::class))->getAttribute($key) ?? null;
return app(Tenant::class)?->getAttribute($key);
}
}