Merge pull request #6451 from filamentphp/dont-require-tenant-to-get-billing-url

Don't require tenant to get billing url
This commit is contained in:
Dan Harrin
2023-05-08 12:04:04 +01:00
committed by GitHub
4 changed files with 5 additions and 5 deletions
@@ -93,7 +93,7 @@
<x-filament::dropdown.list>
<x-filament::dropdown.list.item
:color="$billingItem?->getColor() ?? 'gray'"
:href="$billingItemUrl ?? filament()->getTenantBillingUrl($currentTenant)"
:href="$billingItemUrl ?? filament()->getTenantBillingUrl()"
:icon="$billingItem?->getIcon() ?? 'heroicon-m-credit-card'"
tag="a"
>
+1 -1
View File
@@ -72,7 +72,7 @@ use Illuminate\Support\Facades\Facade;
* @method static Model | null getTenant()
* @method static string | null getTenantAvatarUrl(Model $tenant)
* @method static BillingProvider | null getTenantBillingProvider()
* @method static string | null getTenantBillingUrl(Model $tenant)
* @method static string | null getTenantBillingUrl(Model | null $tenant = null)
* @method static array<MenuItem> getTenantMenuItems()
* @method static string | null getTenantModel()
* @method static string getTenantName(Model $tenant)
+2 -2
View File
@@ -246,9 +246,9 @@ class FilamentManager
return $this->getCurrentContext()->getTenantBillingProvider();
}
public function getTenantBillingUrl(Model $tenant): ?string
public function getTenantBillingUrl(?Model $tenant = null): ?string
{
return $this->getCurrentContext()->getTenantBillingUrl($tenant);
return $this->getCurrentContext()->getTenantBillingUrl($tenant ?? $this->getTenant());
}
public function getTenantRegistrationPage(): ?string
@@ -17,6 +17,6 @@ class VerifySparkBillableIsSubscribed extends VerifyBillableIsSubscribed
{
protected function redirect(string $billableType): string
{
return Filament::getTenantBillingUrl(Filament::getTenant());
return Filament::getTenantBillingUrl();
}
}