mirror of
https://github.com/filamentphp/filament.git
synced 2026-10-24 23:35:30 +08:00
Add typing
This commit is contained in:
@@ -113,6 +113,9 @@ trait HasAuth
|
||||
return $this->isEmailVerificationRequired;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<mixed> $parameters
|
||||
*/
|
||||
public function getEmailVerificationPromptUrl(array $parameters = []): ?string
|
||||
{
|
||||
if (! $this->hasEmailVerification()) {
|
||||
@@ -132,6 +135,9 @@ trait HasAuth
|
||||
return "verified:{$this->getEmailVerificationPromptRouteName()}";
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<mixed> $parameters
|
||||
*/
|
||||
public function getLoginUrl(array $parameters = []): ?string
|
||||
{
|
||||
if (! $this->hasLogin()) {
|
||||
@@ -141,6 +147,9 @@ trait HasAuth
|
||||
return route("filament.{$this->getId()}.auth.login", $parameters);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<mixed> $parameters
|
||||
*/
|
||||
public function getRegistrationUrl(array $parameters = []): ?string
|
||||
{
|
||||
if (! $this->hasRegistration()) {
|
||||
@@ -150,6 +159,9 @@ trait HasAuth
|
||||
return route("filament.{$this->getId()}.auth.register", $parameters);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<mixed> $parameters
|
||||
*/
|
||||
public function getRequestPasswordResetUrl(array $parameters = []): ?string
|
||||
{
|
||||
if (! $this->hasPasswordReset()) {
|
||||
@@ -159,6 +171,9 @@ trait HasAuth
|
||||
return route("filament.{$this->getId()}.auth.password-reset.request", $parameters);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<mixed> $parameters
|
||||
*/
|
||||
public function getVerifyEmailUrl(MustVerifyEmail | Model | Authenticatable $user, array $parameters = []): string
|
||||
{
|
||||
return URL::temporarySignedRoute(
|
||||
@@ -174,6 +189,9 @@ trait HasAuth
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<mixed> $parameters
|
||||
*/
|
||||
public function getResetPasswordUrl(string $token, CanResetPassword | Model | Authenticatable $user, array $parameters = []): string
|
||||
{
|
||||
return URL::signedRoute(
|
||||
@@ -188,6 +206,9 @@ trait HasAuth
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<mixed> $parameters
|
||||
*/
|
||||
public function getLogoutUrl(array $parameters = []): string
|
||||
{
|
||||
return route("filament.{$this->getId()}.auth.logout", $parameters);
|
||||
|
||||
@@ -129,6 +129,9 @@ trait HasTenancy
|
||||
return $this->tenantSlugAttribute;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<mixed> $parameters
|
||||
*/
|
||||
public function getTenantBillingUrl(Model $tenant, array $parameters = []): ?string
|
||||
{
|
||||
if (! $this->hasTenantBilling()) {
|
||||
@@ -146,6 +149,9 @@ trait HasTenancy
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<mixed> $parameters
|
||||
*/
|
||||
public function getTenantRegistrationUrl(array $parameters = []): ?string
|
||||
{
|
||||
if (! $this->hasTenantRegistration()) {
|
||||
|
||||
@@ -206,6 +206,9 @@ class FilamentManager
|
||||
return $this->getCurrentContext()->getHomeUrl();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<mixed> $parameters
|
||||
*/
|
||||
public function getEmailVerificationPromptUrl(array $parameters = []): ?string
|
||||
{
|
||||
return $this->getCurrentContext()->getEmailVerificationPromptUrl($parameters);
|
||||
@@ -216,26 +219,41 @@ class FilamentManager
|
||||
return $this->getCurrentContext()->getEmailVerifiedMiddleware();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<mixed> $parameters
|
||||
*/
|
||||
public function getLoginUrl(array $parameters = []): ?string
|
||||
{
|
||||
return $this->getCurrentContext()->getLoginUrl($parameters);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<mixed> $parameters
|
||||
*/
|
||||
public function getRegistrationUrl(array $parameters = []): ?string
|
||||
{
|
||||
return $this->getCurrentContext()->getRegistrationUrl($parameters);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<mixed> $parameters
|
||||
*/
|
||||
public function getRequestPasswordResetUrl(array $parameters = []): ?string
|
||||
{
|
||||
return $this->getCurrentContext()->getRequestPasswordResetUrl($parameters);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<mixed> $parameters
|
||||
*/
|
||||
public function getVerifyEmailUrl(MustVerifyEmail | Model | Authenticatable $user, array $parameters = []): string
|
||||
{
|
||||
return $this->getCurrentContext()->getVerifyEmailUrl($user, $parameters);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<mixed> $parameters
|
||||
*/
|
||||
public function getResetPasswordUrl(string $token, CanResetPassword | Model | Authenticatable $user, array $parameters = []): string
|
||||
{
|
||||
return $this->getCurrentContext()->getResetPasswordUrl($token, $user, $parameters);
|
||||
@@ -246,6 +264,9 @@ class FilamentManager
|
||||
return $this->getCurrentContext()->getTenantBillingProvider();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<mixed> $parameters
|
||||
*/
|
||||
public function getTenantBillingUrl(?Model $tenant = null, array $parameters = []): ?string
|
||||
{
|
||||
return $this->getCurrentContext()->getTenantBillingUrl($tenant ?? $this->getTenant(), $parameters);
|
||||
@@ -256,11 +277,17 @@ class FilamentManager
|
||||
return $this->getCurrentContext()->getTenantRegistrationPage();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<mixed> $parameters
|
||||
*/
|
||||
public function getTenantRegistrationUrl(array $parameters = []): ?string
|
||||
{
|
||||
return $this->getCurrentContext()->getTenantRegistrationUrl($parameters);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<mixed> $parameters
|
||||
*/
|
||||
public function getLogoutUrl(array $parameters = []): string
|
||||
{
|
||||
return $this->getCurrentContext()->getLogoutUrl($parameters);
|
||||
|
||||
Reference in New Issue
Block a user