mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 20:14:03 +00:00
remove ignition dependencies
This commit is contained in:
parent
588d1fcc0d
commit
e1fc0e107d
7 changed files with 7 additions and 62 deletions
|
|
@ -20,8 +20,6 @@
|
||||||
"ext-json": "*",
|
"ext-json": "*",
|
||||||
"illuminate/support": "^12.0",
|
"illuminate/support": "^12.0",
|
||||||
"laravel/tinker": "^2.0",
|
"laravel/tinker": "^2.0",
|
||||||
"facade/ignition-contracts": "^1.0.2",
|
|
||||||
"spatie/ignition": "^1.4",
|
|
||||||
"ramsey/uuid": "^4.7.3",
|
"ramsey/uuid": "^4.7.3",
|
||||||
"stancl/jobpipeline": "2.0.0-rc5",
|
"stancl/jobpipeline": "2.0.0-rc5",
|
||||||
"stancl/virtualcolumn": "^1.5.0",
|
"stancl/virtualcolumn": "^1.5.0",
|
||||||
|
|
|
||||||
|
|
@ -5,49 +5,11 @@ declare(strict_types=1);
|
||||||
namespace Stancl\Tenancy\Contracts;
|
namespace Stancl\Tenancy\Contracts;
|
||||||
|
|
||||||
use Exception;
|
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 function tenantCouldNotBeIdentified(string $how): void
|
||||||
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
|
|
||||||
{
|
{
|
||||||
$this->message = 'Tenant could not be identified ' . $how;
|
$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',
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,6 @@ class TenantColumnNotWhitelistedException extends TenantCouldNotBeIdentifiedExce
|
||||||
{
|
{
|
||||||
public function __construct(int|string $tenant_id)
|
public function __construct(int|string $tenant_id)
|
||||||
{
|
{
|
||||||
$this
|
$this->tenantCouldNotBeIdentified("on path with tenant key: $tenant_id (column not whitelisted)");
|
||||||
->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.');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,6 @@ class TenantCouldNotBeIdentifiedByIdException extends TenantCouldNotBeIdentified
|
||||||
{
|
{
|
||||||
public function __construct(int|string $tenant_id)
|
public function __construct(int|string $tenant_id)
|
||||||
{
|
{
|
||||||
$this
|
$this->tenantCouldNotBeIdentified("by tenant key: $tenant_id");
|
||||||
->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?');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,6 @@ class TenantCouldNotBeIdentifiedByPathException extends TenantCouldNotBeIdentifi
|
||||||
{
|
{
|
||||||
public function __construct(int|string $tenant_id)
|
public function __construct(int|string $tenant_id)
|
||||||
{
|
{
|
||||||
$this
|
$this->tenantCouldNotBeIdentified("on path with tenant key: $tenant_id");
|
||||||
->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?');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,6 @@ class TenantCouldNotBeIdentifiedByRequestDataException extends TenantCouldNotBeI
|
||||||
{
|
{
|
||||||
public function __construct(mixed $payload)
|
public function __construct(mixed $payload)
|
||||||
{
|
{
|
||||||
$this
|
$this->tenantCouldNotBeIdentified("by request data with payload: $payload");
|
||||||
->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?');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,6 @@ class TenantCouldNotBeIdentifiedOnDomainException extends TenantCouldNotBeIdenti
|
||||||
{
|
{
|
||||||
public function __construct(string $domain)
|
public function __construct(string $domain)
|
||||||
{
|
{
|
||||||
$this
|
$this->tenantCouldNotBeIdentified("on domain $domain");
|
||||||
->tenantCouldNotBeIdentified("on domain $domain")
|
|
||||||
->title('Tenant could not be identified on this domain')
|
|
||||||
->description('Did you forget to create a tenant for this domain?');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue