Properly setup Mount model, add database migration, get mount admin page added
This commit is contained in:
parent
59a150148a
commit
00d1b5861a
5 changed files with 169 additions and 27 deletions
32
app/Repositories/Eloquent/MountRepository.php
Normal file
32
app/Repositories/Eloquent/MountRepository.php
Normal 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());
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue