Add increment id to mount, add basic mount view page
This commit is contained in:
parent
976b669059
commit
77150b2551
8 changed files with 203 additions and 12 deletions
|
@ -5,6 +5,8 @@ namespace Pterodactyl\Repositories\Eloquent;
|
|||
use Pterodactyl\Models\Mount;
|
||||
use Illuminate\Support\Collection;
|
||||
use Pterodactyl\Repositories\Concerns\Searchable;
|
||||
use Illuminate\Database\Eloquent\ModelNotFoundException;
|
||||
use Pterodactyl\Exceptions\Repository\RecordNotFoundException;
|
||||
|
||||
class MountRepository extends EloquentRepository
|
||||
{
|
||||
|
@ -29,4 +31,21 @@ class MountRepository extends EloquentRepository
|
|||
{
|
||||
return $this->getBuilder()->withCount('eggs', 'nodes')->get($this->getColumns());
|
||||
}
|
||||
|
||||
/**
|
||||
* Return all of the mounts and their respective relations.
|
||||
*
|
||||
* @param string $id
|
||||
* @return mixed
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function getWithRelations(string $id): Mount
|
||||
{
|
||||
try {
|
||||
return $this->getBuilder()->with('eggs', 'nodes')->findOrFail($id, $this->getColumns());
|
||||
} catch (ModelNotFoundException $exception) {
|
||||
throw new RecordNotFoundException;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue