mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-19 14:53:45 +02:00
Add increment id to mount, add basic mount view page
This commit is contained in:
@@ -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 New Issue
Block a user