From e1fc0e107d236a113ab5e67fc1fa0044925100e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Wed, 18 Jun 2025 23:29:24 +0200 Subject: [PATCH] remove ignition dependencies --- composer.json | 2 - .../TenantCouldNotBeIdentifiedException.php | 42 +------------------ .../TenantColumnNotWhitelistedException.php | 5 +-- ...enantCouldNotBeIdentifiedByIdException.php | 5 +-- ...antCouldNotBeIdentifiedByPathException.php | 5 +-- ...dNotBeIdentifiedByRequestDataException.php | 5 +-- ...tCouldNotBeIdentifiedOnDomainException.php | 5 +-- 7 files changed, 7 insertions(+), 62 deletions(-) diff --git a/composer.json b/composer.json index e3a7faf4..3d3bd3eb 100644 --- a/composer.json +++ b/composer.json @@ -20,8 +20,6 @@ "ext-json": "*", "illuminate/support": "^12.0", "laravel/tinker": "^2.0", - "facade/ignition-contracts": "^1.0.2", - "spatie/ignition": "^1.4", "ramsey/uuid": "^4.7.3", "stancl/jobpipeline": "2.0.0-rc5", "stancl/virtualcolumn": "^1.5.0", diff --git a/src/Contracts/TenantCouldNotBeIdentifiedException.php b/src/Contracts/TenantCouldNotBeIdentifiedException.php index a83a0c75..b0ff74a4 100644 --- a/src/Contracts/TenantCouldNotBeIdentifiedException.php +++ b/src/Contracts/TenantCouldNotBeIdentifiedException.php @@ -5,49 +5,11 @@ declare(strict_types=1); namespace Stancl\Tenancy\Contracts; use Exception; -use Spatie\ErrorSolutions\Contracts\BaseSolution; -use Spatie\ErrorSolutions\Contracts\ProvidesSolution; -abstract class TenantCouldNotBeIdentifiedException extends Exception implements ProvidesSolution +abstract class TenantCouldNotBeIdentifiedException extends Exception { - /** Default solution title. */ - protected string $solutionTitle = 'Tenant could not be identified'; - - /** Default solution description. */ - protected string $solutionDescription = 'Are you sure this tenant exists?'; - - /** Set the message. */ - protected function tenantCouldNotBeIdentified(string $how): static + protected function tenantCouldNotBeIdentified(string $how): void { $this->message = 'Tenant could not be identified ' . $how; - - return $this; - } - - /** Set the solution title. */ - protected function title(string $solutionTitle): static - { - $this->solutionTitle = $solutionTitle; - - return $this; - } - - /** Set the solution description. */ - protected function description(string $solutionDescription): static - { - $this->solutionDescription = $solutionDescription; - - return $this; - } - - /** Get the Ignition description. */ - public function getSolution(): BaseSolution - { - return BaseSolution::create($this->solutionTitle) - ->setSolutionDescription($this->solutionDescription) - ->setDocumentationLinks([ - 'Tenants' => 'https://tenancyforlaravel.com/docs/v3/tenants', - 'Tenant Identification' => 'https://tenancyforlaravel.com/docs/v3/tenant-identification', - ]); } } diff --git a/src/Exceptions/TenantColumnNotWhitelistedException.php b/src/Exceptions/TenantColumnNotWhitelistedException.php index 6b59d8f7..20eb70b2 100644 --- a/src/Exceptions/TenantColumnNotWhitelistedException.php +++ b/src/Exceptions/TenantColumnNotWhitelistedException.php @@ -10,9 +10,6 @@ class TenantColumnNotWhitelistedException extends TenantCouldNotBeIdentifiedExce { public function __construct(int|string $tenant_id) { - $this - ->tenantCouldNotBeIdentified("on path with tenant key: $tenant_id (column not whitelisted)") - ->title('Tenant could not be identified on this route because the used column is not whitelisted.') - ->description('Please add the column to the list of allowed columns in the PathTenantResolver config.'); + $this->tenantCouldNotBeIdentified("on path with tenant key: $tenant_id (column not whitelisted)"); } } diff --git a/src/Exceptions/TenantCouldNotBeIdentifiedByIdException.php b/src/Exceptions/TenantCouldNotBeIdentifiedByIdException.php index 6f61455e..36ef1d09 100644 --- a/src/Exceptions/TenantCouldNotBeIdentifiedByIdException.php +++ b/src/Exceptions/TenantCouldNotBeIdentifiedByIdException.php @@ -10,9 +10,6 @@ class TenantCouldNotBeIdentifiedByIdException extends TenantCouldNotBeIdentified { public function __construct(int|string $tenant_id) { - $this - ->tenantCouldNotBeIdentified("by tenant key: $tenant_id") - ->title('Tenant could not be identified with that key') - ->description('Are you sure the key is correct and the tenant exists?'); + $this->tenantCouldNotBeIdentified("by tenant key: $tenant_id"); } } diff --git a/src/Exceptions/TenantCouldNotBeIdentifiedByPathException.php b/src/Exceptions/TenantCouldNotBeIdentifiedByPathException.php index ef51f8bf..a004b39a 100644 --- a/src/Exceptions/TenantCouldNotBeIdentifiedByPathException.php +++ b/src/Exceptions/TenantCouldNotBeIdentifiedByPathException.php @@ -10,9 +10,6 @@ class TenantCouldNotBeIdentifiedByPathException extends TenantCouldNotBeIdentifi { public function __construct(int|string $tenant_id) { - $this - ->tenantCouldNotBeIdentified("on path with tenant key: $tenant_id") - ->title('Tenant could not be identified on this path') - ->description('Did you forget to create a tenant for this path?'); + $this->tenantCouldNotBeIdentified("on path with tenant key: $tenant_id"); } } diff --git a/src/Exceptions/TenantCouldNotBeIdentifiedByRequestDataException.php b/src/Exceptions/TenantCouldNotBeIdentifiedByRequestDataException.php index 1f1c98a1..ab2b92a9 100644 --- a/src/Exceptions/TenantCouldNotBeIdentifiedByRequestDataException.php +++ b/src/Exceptions/TenantCouldNotBeIdentifiedByRequestDataException.php @@ -10,9 +10,6 @@ class TenantCouldNotBeIdentifiedByRequestDataException extends TenantCouldNotBeI { public function __construct(mixed $payload) { - $this - ->tenantCouldNotBeIdentified("by request data with payload: $payload") - ->title('Tenant could not be identified using this request data') - ->description('Did you forget to create a tenant with this id?'); + $this->tenantCouldNotBeIdentified("by request data with payload: $payload"); } } diff --git a/src/Exceptions/TenantCouldNotBeIdentifiedOnDomainException.php b/src/Exceptions/TenantCouldNotBeIdentifiedOnDomainException.php index 0421fe1b..5470c60a 100644 --- a/src/Exceptions/TenantCouldNotBeIdentifiedOnDomainException.php +++ b/src/Exceptions/TenantCouldNotBeIdentifiedOnDomainException.php @@ -10,9 +10,6 @@ class TenantCouldNotBeIdentifiedOnDomainException extends TenantCouldNotBeIdenti { public function __construct(string $domain) { - $this - ->tenantCouldNotBeIdentified("on domain $domain") - ->title('Tenant could not be identified on this domain') - ->description('Did you forget to create a tenant for this domain?'); + $this->tenantCouldNotBeIdentified("on domain $domain"); } }