Fix inability to create a server
This commit is contained in:
parent
5170bcf41a
commit
88562b5cd6
8 changed files with 102 additions and 50 deletions
|
@ -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}
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue