id : $location; $count = $this->nodeRepository->findCountWhere([['location_id', '=', $location]]); if ($count > 0) { throw new HasActiveNodesException(trans('exceptions.locations.has_nodes')); } return $this->repository->delete($location); } }