Fix inability to create a server

This commit is contained in:
Dane Everitt 2017-11-05 15:36:37 -06:00
parent 5170bcf41a
commit 88562b5cd6
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
8 changed files with 102 additions and 50 deletions

View file

@ -39,6 +39,22 @@ class ServerRepository extends EloquentRepository implements ServerRepositoryInt
return is_null($paginate) ? $instance->get($this->getColumns()) : $instance->paginate($paginate, $this->getColumns());
}
/**
* Load the egg relations onto the server model.
*
* @param \Pterodactyl\Models\Server $server
* @param bool $refresh
* @return \Pterodactyl\Models\Server
*/
public function loadEggRelations(Server $server, bool $refresh = false): Server
{
if (! $server->relationLoaded('egg') || $refresh) {
$server->load('egg.scriptFrom');
}
return $server;
}
/**
* {@inheritdoc}
*/