3 namespace BookStack\Auth\Access;
5 use BookStack\Auth\User;
6 use BookStack\Notifications\UserInvite;
8 class UserInviteService extends UserTokenService
10 protected string $tokenTable = 'user_invites';
11 protected int $expiryTime = 336; // Two weeks
14 * Send an invitation to a user to sign into BookStack
15 * Removes existing invitation tokens.
17 public function sendInvitation(User $user)
19 $this->deleteByUser($user);
20 $token = $this->createTokenForUser($user);
21 $user->notify(new UserInvite($token));