cbcf62086f
Co-authored-by: DaneEveritt <dane@daneeveritt.com>
27 lines
724 B
PHP
27 lines
724 B
PHP
<?php
|
|
|
|
namespace Pterodactyl\Repositories\Eloquent;
|
|
|
|
use Illuminate\Support\Collection;
|
|
use Pterodactyl\Models\DatabaseHost;
|
|
use Pterodactyl\Contracts\Repository\DatabaseHostRepositoryInterface;
|
|
|
|
class DatabaseHostRepository extends EloquentRepository implements DatabaseHostRepositoryInterface
|
|
{
|
|
/**
|
|
* Return the model backing this repository.
|
|
*/
|
|
public function model(): string
|
|
{
|
|
return DatabaseHost::class;
|
|
}
|
|
|
|
/**
|
|
* Return database hosts with a count of databases and the node
|
|
* information for which it is attached.
|
|
*/
|
|
public function getWithViewDetails(): Collection
|
|
{
|
|
return $this->getBuilder()->withCount('databases')->with('node')->get();
|
|
}
|
|
}
|