userService->getUnexistingIds($ids); if (is_array($unexisting)) { return $unexisting; } return User::whereIn('id', $ids)->update([ 'deleted_at' => now()->toDateTimeImmutable() ]); } public function moveUsersFromTrash(array $ids): bool | array { $unexisting = $this->userService->getUnexistingIds($ids); if (is_array($unexisting)) { return $unexisting; } return User::whereIn('id', $ids)->update([ 'deleted_at' => null ]); } public function cleanUsersFromTrash(array $ids): bool | null | array { $unexisting = $this->userService->getUnexistingIds($ids); if (is_array($unexisting)) { return $unexisting; } return User::whereIn('id', $ids)->whereNotNull('deleted_at')->delete(); } }