Skip to content

Commit 734b17a

Browse files
committed
Added auth check when creating team owner.
1 parent 090d2e5 commit 734b17a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Listeners/CreatedTeamListener.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ class CreatedTeamListener
44
{
55
public function handle($team)
66
{
7-
$team->members()->syncWithoutDetaching([auth()->user()->id]);
7+
if (auth()->check()) {
8+
$team->members()->syncWithoutDetaching([auth()->user()->id]);
9+
}
810
}
911
}

0 commit comments

Comments
 (0)