mirror of
https://github.com/fergalmoran/OpnForm.git
synced 2026-01-20 23:44:16 +00:00
Initial commit
This commit is contained in:
26
app/Exceptions/Workspaces/WorkspaceAlreadyExisting.php
Normal file
26
app/Exceptions/Workspaces/WorkspaceAlreadyExisting.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Exceptions\Workspaces;
|
||||
|
||||
use App\Models\Workspace;
|
||||
use Exception;
|
||||
|
||||
class WorkspaceAlreadyExisting extends Exception
|
||||
{
|
||||
public function __construct(public Workspace $workspace)
|
||||
{
|
||||
}
|
||||
|
||||
public function getErrorMessage()
|
||||
{
|
||||
$owner = $this->workspace->users()->first();
|
||||
if (!$owner) {
|
||||
return 'A user already connected that workspace to another NotionForms account. You or the current workspace
|
||||
owner must have a NotionForms Enterprise subscription for you to add this Notion workspace. Please upgrade
|
||||
with an Enterprise subscription, or contact us to get help.';
|
||||
}
|
||||
|
||||
return '"'.$owner->name.'" already connected that workspace to his NotionForms account. In order to collaborate,
|
||||
one of you must have a NotionForms Enterprise subscription. Please upgrade or contact us to get help.';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user