diff --git a/app/Observers/GroupObserver.php b/app/Observers/GroupObserver.php index d417cdf..f5c4bb5 100644 --- a/app/Observers/GroupObserver.php +++ b/app/Observers/GroupObserver.php @@ -13,11 +13,11 @@ class GroupObserver { public function created(Group $group) { - if (App::isLocal()) { + if (! App::isProduction()) { return; } - if ($group->type === GroupTypeEnum::Team && $group->parent->nextcloud_folder_id) { + if ($group->type === GroupTypeEnum::Team && $group->parent?->nextcloud_folder_id) { NextcloudService::createGroup($group->hashid); // Parent->name / Group->name NextcloudService::setDisplayName($group->hashid, $group->parent->name.' / '.$group->name); @@ -34,7 +34,7 @@ public function created(Group $group) public function updated(Group $group): void { - if (App::isLocal()) { + if (! App::isProduction()) { return; } @@ -70,7 +70,7 @@ public function updated(Group $group): void public function deleted(Group $group) { - if (App::isLocal()) { + if (! App::isProduction()) { return; }