invitation = $invitation;
}
/**
* Redeem the invitation for the signed-in user, then send them into the
* app. Workspace invitations are refused once the workspace is full.
*/
public function accept(): void
{
if (! $this->invitation->isValid()) {
return;
}
$organization = $this->invitation->inviteable;
if ($organization instanceof Organization && ! $organization->canAddMember()) {
$this->addError('invitation', __('This workspace is full, so this invitation can no longer be accepted.'));
return;
}
$this->invitation->accept(auth()->user());
$this->redirect(route('dashboard'), navigate: true);
}
}; ?>
{{ __('Invitation') }}
@if ($invitation->isAccepted())
{{ __('This invitation has already been accepted.') }}
@elseif ($invitation->isExpired())
{{ __('This invitation has expired. Ask the sender to invite you again.') }}
@else
@if ($invitation->isForFolder())
{{ __(':inviter invited you to collaborate on the folder ":name" as :role.', [
'inviter' => $invitation->inviter?->name ?? __('Someone'),
'name' => $invitation->inviteable?->name ?? __('a folder'),
'role' => $invitation->roleLabel(),
]) }}
@else
{{ __(':inviter invited you to join the ":name" workspace as :role.', [
'inviter' => $invitation->inviter?->name ?? __('Someone'),
'name' => $invitation->inviteable?->name ?? __('a workspace'),
'role' => $invitation->roleLabel(),
]) }}
@endif
@error('invitation')
{{ $message }}
@enderror
{{ __('Not now') }}
{{ __('Accept invitation') }}
@endif