where('nest_id', array_get($data, 'nest_id')) ->where('id', array_get($data, 'config_from')) ->count(); if ($results !== 1) { throw new NoParentConfigurationFoundException(trans('exceptions.nest.egg.must_be_child')); } } /** @var Egg $egg */ $egg = Egg::query()->create(array_merge($data, [ 'uuid' => Uuid::uuid4()->toString(), 'author' => $this->config->get('pterodactyl.service.author'), ])); return $egg; } }