1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 12:54:05 +00:00
This commit is contained in:
George 2022-02-13 16:37:30 +01:00
parent 492d1cc538
commit 2e156ef0ce
5 changed files with 36 additions and 49 deletions

View file

@ -10,7 +10,6 @@
"require": {
"ext-json": "*",
"illuminate/support": "^6.0|^7.0|^8.0|^9.0",
"facade/ignition-contracts": "^1.0",
"ramsey/uuid": "^3.7|^4.0",
"stancl/jobpipeline": "^1.0",
"stancl/virtualcolumn": "^1.0"

View file

@ -4,25 +4,22 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Exceptions;
use Facade\IgnitionContracts\BaseSolution;
use Facade\IgnitionContracts\ProvidesSolution;
use Facade\IgnitionContracts\Solution;
use Stancl\Tenancy\Contracts\TenantCouldNotBeIdentifiedException;
// todo: in v4 this should be suffixed with Exception
class TenantCouldNotBeIdentifiedById extends TenantCouldNotBeIdentifiedException implements ProvidesSolution
class TenantCouldNotBeIdentifiedById extends TenantCouldNotBeIdentifiedException
{
public function __construct($tenant_id)
{
parent::__construct("Tenant could not be identified with tenant_id: $tenant_id");
}
public function getSolution(): Solution
{
return BaseSolution::create('Tenant could not be identified with that ID')
->setSolutionDescription('Are you sure the ID is correct and the tenant exists?')
->setDocumentationLinks([
'Initializing Tenants' => 'https://tenancyforlaravel.com/docs/v3/tenants',
]);
}
// public function getSolution(): Solution
// {
// return BaseSolution::create('Tenant could not be identified with that ID')
// ->setSolutionDescription('Are you sure the ID is correct and the tenant exists?')
// ->setDocumentationLinks([
// 'Initializing Tenants' => 'https://tenancyforlaravel.com/docs/v3/tenants',
// ]);
// }
}

View file

@ -4,24 +4,21 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Exceptions;
use Facade\IgnitionContracts\BaseSolution;
use Facade\IgnitionContracts\ProvidesSolution;
use Facade\IgnitionContracts\Solution;
use Stancl\Tenancy\Contracts\TenantCouldNotBeIdentifiedException;
class TenantCouldNotBeIdentifiedByPathException extends TenantCouldNotBeIdentifiedException implements ProvidesSolution
class TenantCouldNotBeIdentifiedByPathException extends TenantCouldNotBeIdentifiedException
{
public function __construct($tenant_id)
{
parent::__construct("Tenant could not be identified on path with tenant_id: $tenant_id");
}
public function getSolution(): Solution
{
return BaseSolution::create('Tenant could not be identified on this path')
->setSolutionDescription('Did you forget to create a tenant for this path?')
->setDocumentationLinks([
'Creating Tenants' => 'https://tenancyforlaravel.com/docs/v3/tenants/',
]);
}
// public function getSolution(): Solution
// {
// return BaseSolution::create('Tenant could not be identified on this path')
// ->setSolutionDescription('Did you forget to create a tenant for this path?')
// ->setDocumentationLinks([
// 'Creating Tenants' => 'https://tenancyforlaravel.com/docs/v3/tenants/',
// ]);
// }
}

View file

@ -4,24 +4,21 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Exceptions;
use Facade\IgnitionContracts\BaseSolution;
use Facade\IgnitionContracts\ProvidesSolution;
use Facade\IgnitionContracts\Solution;
use Stancl\Tenancy\Contracts\TenantCouldNotBeIdentifiedException;
class TenantCouldNotBeIdentifiedByRequestDataException extends TenantCouldNotBeIdentifiedException implements ProvidesSolution
class TenantCouldNotBeIdentifiedByRequestDataException extends TenantCouldNotBeIdentifiedException
{
public function __construct($tenant_id)
{
parent::__construct("Tenant could not be identified by request data with payload: $tenant_id");
}
public function getSolution(): Solution
{
return BaseSolution::create('Tenant could not be identified with this request data')
->setSolutionDescription('Did you forget to create a tenant with this id?')
->setDocumentationLinks([
'Creating Tenants' => 'https://tenancyforlaravel.com/docs/v3/tenants/',
]);
}
// public function getSolution(): Solution
// {
// return BaseSolution::create('Tenant could not be identified with this request data')
// ->setSolutionDescription('Did you forget to create a tenant with this id?')
// ->setDocumentationLinks([
// 'Creating Tenants' => 'https://tenancyforlaravel.com/docs/v3/tenants/',
// ]);
// }
}

View file

@ -4,24 +4,21 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Exceptions;
use Facade\IgnitionContracts\BaseSolution;
use Facade\IgnitionContracts\ProvidesSolution;
use Facade\IgnitionContracts\Solution;
use Stancl\Tenancy\Contracts\TenantCouldNotBeIdentifiedException;
class TenantCouldNotBeIdentifiedOnDomainException extends TenantCouldNotBeIdentifiedException implements ProvidesSolution
class TenantCouldNotBeIdentifiedOnDomainException extends TenantCouldNotBeIdentifiedException
{
public function __construct($domain)
{
parent::__construct("Tenant could not be identified on domain $domain");
}
public function getSolution(): Solution
{
return BaseSolution::create('Tenant could not be identified on this domain')
->setSolutionDescription('Did you forget to create a tenant for this domain?')
->setDocumentationLinks([
'Creating Tenants' => 'https://tenancyforlaravel.com/docs/v3/tenants/',
]);
}
// public function getSolution(): Solution
// {
// return BaseSolution::create('Tenant could not be identified on this domain')
// ->setSolutionDescription('Did you forget to create a tenant for this domain?')
// ->setDocumentationLinks([
// 'Creating Tenants' => 'https://tenancyforlaravel.com/docs/v3/tenants/',
// ]);
// }
}