Properly setup Mount model, add database migration, get mount admin page added

This commit is contained in:
Matthew Penner 2020-05-20 18:00:53 -06:00
parent 59a150148a
commit 00d1b5861a
5 changed files with 169 additions and 27 deletions

View file

@ -0,0 +1,32 @@
<?php
namespace Pterodactyl\Repositories\Eloquent;
use Pterodactyl\Models\Mount;
use Illuminate\Support\Collection;
use Pterodactyl\Repositories\Concerns\Searchable;
class MountRepository extends EloquentRepository
{
use Searchable;
/**
* Return the model backing this repository.
*
* @return string
*/
public function model()
{
return Mount::class;
}
/**
* Return mounts with a count of eggs, nodes, and servers attached to it.
*
* @return \Illuminate\Support\Collection
*/
public function getAllWithDetails(): Collection
{
return $this->getBuilder()->withCount('eggs', 'nodes')->get($this->getColumns());
}
}