mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-19 14:53:45 +02:00
@@ -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 New Issue
Block a user