id : $location; Assert::integerish($location, 'First argument passed to handle must be numeric or an instance of ' . Location::class . ', received %s.'); $count = $this->nodeRepository->findCountWhere([['location_id', '=', $location]]); if ($count > 0) { throw new HasActiveNodesException(trans('exceptions.locations.has_nodes')); } return $this->repository->delete($location); } }