mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-28 09:14:44 +02:00
Fix this
This commit is contained in:
parent
3a95105931
commit
c4c4834acc
@ -26,19 +26,13 @@ class EggCreationService
|
||||
{
|
||||
$data['config_from'] = array_get($data, 'config_from');
|
||||
if (!is_null($data['config_from'])) {
|
||||
$results = Egg::query()
|
||||
->where('nest_id', array_get($data, 'nest_id'))
|
||||
->where('id', array_get($data, 'config_from'))
|
||||
->count();
|
||||
|
||||
if ($results !== 1) {
|
||||
throw new NoParentConfigurationFoundException(trans('exceptions.egg.invalid_copy_id'));
|
||||
}
|
||||
$parentEgg = Egg::query()->find(array_get($data, 'config_from'));
|
||||
throw_unless($parentEgg, new NoParentConfigurationFoundException(trans('exceptions.egg.invalid_copy_id')));
|
||||
}
|
||||
|
||||
return Egg::query()->create(array_merge($data, [
|
||||
'uuid' => Uuid::uuid4()->toString(),
|
||||
'author' => $this->config->get('pterodactyl.service.author'),
|
||||
'author' => $this->config->get('panel.service.author'),
|
||||
]));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user