Skip to content

Commit

Permalink
User invitation issue solved.
Browse files Browse the repository at this point in the history
  • Loading branch information
cuneytsenturk committed Apr 28, 2023
1 parent 08c2904 commit 715b81c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/Jobs/Auth/CreateInvitation.php
Expand Up @@ -23,6 +23,12 @@ public function __construct($user)
public function handle(): UserInvitation
{
\DB::transaction(function () {
$invitations = UserInvitation::where('user_id', $this->user->id)->get();

foreach ($invitations as $invitation) {
$invitation->delete();
}

$this->invitation = UserInvitation::create([
'user_id' => $this->user->id,
'token' => (string) Str::uuid(),
Expand Down

0 comments on commit 715b81c

Please sign in to comment.