databaseRepository->findCountWhere([['database_host_id', '=', $host]]); if ($count > 0) { throw new HasActiveServersException(trans('exceptions.databases.delete_has_databases')); } $host = DatabaseHost::query()->find($host); if ($host) { return $host->delete(); } return true; } }