findOrFail($location); $count = $location->nodes()->count(); if ($count > 0) { throw new HasActiveNodesException(trans('exceptions.locations.has_nodes')); } return $location->delete(); } }