@@ -173,42 +173,22 @@ protected function performDeveloperDelete(): void
173173 // Load relationships once to avoid N+1 queries
174174 $ this ->load (['couples ' , 'users ' ]);
175175
176- // Disable activity logging globally during cleanup
177- config (['activitylog.enabled ' => false ]);
178-
179- try {
180- // Delete all persons and their photos and files
181- $ this ->persons ->each (function ($ person ): void {
182- // remove photos
183- // remove files
184-
185- $ person ->forceDelete ();
186- });
187-
188- // Delete all couples
189- $ this ->couples ->each (function ($ couple ): void {
190- $ couple ->delete ();
191- });
192-
193- // Disconnect all users from this team
194- $ this ->users ()->detach ();
195- } finally {
196- // Re-enable activity logging
197- config (['activitylog.enabled ' => true ]);
198- }
199-
200- // Log a single comprehensive activity after cleanup
201- activity ()
202- ->causedBy (auth ()->user ())
203- ->performedOn ($ this )
204- ->withProperties ([
205- 'deleted_persons_count ' => $ this ->persons ->count (),
206- 'deleted_couples_count ' => $ this ->couples ->count (),
207- 'detached_users_count ' => $ this ->users ->count (),
208- 'team_name ' => $ this ->name ,
209- 'reason ' => 'Developer force delete with cleanup ' ,
210- ])
211- ->log ('Team deleted with full cleanup by developer ' );
176+ // Delete all persons and their photos and files
177+ $ this ->persons ->each (function ($ person ): void {
178+ // TODO
179+ // remove photos
180+ // remove files
181+
182+ $ person ->forceDelete ();
183+ });
184+
185+ // Delete all couples
186+ $ this ->couples ->each (function ($ couple ): void {
187+ $ couple ->delete ();
188+ });
189+
190+ // Disconnect all users from this team
191+ $ this ->users ()->detach ();
212192 });
213193 }
214194}
0 commit comments