Remove old Theme::js calls in blade layouts. Persist checkboxes, Server Owner, Node, Default Allocation, and Additional Allocations on servers/new.blade.php

This commit is contained in:
Matthew Penner 2020-04-11 13:56:03 -06:00
parent fb96d9468e
commit b5e50719ac
9 changed files with 209 additions and 73 deletions

View file

@ -54,4 +54,22 @@ class UserRepository extends EloquentRepository implements UserRepositoryInterfa
return $item;
});
}
/**
* Returns a user with the given id in a format that can be used for dropdowns.
*
* @param int $id
* @return \Pterodactyl\Models\Model
*/
public function filterById(int $id): \Pterodactyl\Models\Model
{
$this->setColumns([
'id', 'email', 'username', 'name_first', 'name_last',
]);
$model = $this->getBuilder()->findOrFail($id, $this->getColumns())->getModel();
$model->md5 = md5(strtolower($model->email));
return $model;
}
}