diff --git a/composer.json b/composer.json index cd31d282..f3622760 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,8 @@ ], "require": { "illuminate/support": "^6.0", - "webpatser/laravel-uuid": "^3.0" + "webpatser/laravel-uuid": "^3.0", + "facade/ignition-contracts": "^1.0" }, "require-dev": { "vlucas/phpdotenv": "^3.3", diff --git a/src/Exceptions/TenantCouldNotBeIdentifiedException.php b/src/Exceptions/TenantCouldNotBeIdentifiedException.php index 1d1b9633..a25d8ddb 100644 --- a/src/Exceptions/TenantCouldNotBeIdentifiedException.php +++ b/src/Exceptions/TenantCouldNotBeIdentifiedException.php @@ -4,10 +4,23 @@ declare(strict_types=1); namespace Stancl\Tenancy\Exceptions; -class TenantCouldNotBeIdentifiedException extends \Exception +use Facade\IgnitionContracts\BaseSolution; +use Facade\IgnitionContracts\ProvidesSolution; +use Facade\IgnitionContracts\Solution; + +class TenantCouldNotBeIdentifiedException extends \Exception implements ProvidesSolution { public function __construct($domain) { $this->message = "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://tenancy.samuelstancl.me/docs/v2/creating-tenants/', + ]); + } }