parent
fb2909a1c7
commit
6409fffdad
22 changed files with 143 additions and 166 deletions
|
@ -31,12 +31,16 @@ class SubuserRepository extends EloquentRepository implements SubuserRepositoryI
|
|||
* @param bool $refresh
|
||||
* @return \Pterodactyl\Models\Subuser
|
||||
*/
|
||||
public function getWithServer(Subuser $subuser, bool $refresh = false): Subuser
|
||||
public function loadServerAndUserRelations(Subuser $subuser, bool $refresh = false): Subuser
|
||||
{
|
||||
if (! $subuser->relationLoaded('server') || $refresh) {
|
||||
$subuser->load('server');
|
||||
}
|
||||
|
||||
if (! $subuser->relationLoaded('user') || $refresh) {
|
||||
$subuser->load('user');
|
||||
}
|
||||
|
||||
return $subuser;
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ class TaskRepository extends EloquentRepository implements TaskRepositoryInterfa
|
|||
{
|
||||
Assert::integerish($id, 'First argument passed to getTaskWithServer must be numeric, received %s.');
|
||||
|
||||
$instance = $this->getBuilder()->with('server')->find($id, $this->getColumns());
|
||||
$instance = $this->getBuilder()->with('server.user')->find($id, $this->getColumns());
|
||||
if (! $instance) {
|
||||
throw new RecordNotFoundException;
|
||||
}
|
||||
|
|
Reference in a new issue