1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-14 06:54:04 +00:00

misc improvements - stronger types, exception refactor

This commit is contained in:
Samuel Štancl 2022-08-26 21:35:17 +02:00
parent ddc7cf49c3
commit 55d0a9ab87
34 changed files with 179 additions and 209 deletions

View file

@ -4,24 +4,15 @@ 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)
public function __construct(mixed $payload)
{
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/',
]);
$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?');
}
}