]> BookStack Code Mirror - bookstack/blob - app/Auth/Access/UserInviteService.php
Apply fixes from StyleCI
[bookstack] / app / Auth / Access / UserInviteService.php
1 <?php
2
3 namespace BookStack\Auth\Access;
4
5 use BookStack\Auth\User;
6 use BookStack\Notifications\UserInvite;
7
8 class UserInviteService extends UserTokenService
9 {
10     protected $tokenTable = 'user_invites';
11     protected $expiryTime = 336; // Two weeks
12
13     /**
14      * Send an invitation to a user to sign into BookStack
15      * Removes existing invitation tokens.
16      *
17      * @param User $user
18      */
19     public function sendInvitation(User $user)
20     {
21         $this->deleteByUser($user);
22         $token = $this->createTokenForUser($user);
23         $user->notify(new UserInvite($token));
24     }
25 }