Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pterodactyl
GitHub Repository: pterodactyl/panel
Path: blob/1.0-develop/app/Repositories/Eloquent/DatabaseHostRepository.php
7460 views
1
<?php
2
3
namespace Pterodactyl\Repositories\Eloquent;
4
5
use Illuminate\Support\Collection;
6
use Pterodactyl\Models\DatabaseHost;
7
use Pterodactyl\Contracts\Repository\DatabaseHostRepositoryInterface;
8
9
class DatabaseHostRepository extends EloquentRepository implements DatabaseHostRepositoryInterface
10
{
11
/**
12
* Return the model backing this repository.
13
*/
14
public function model(): string
15
{
16
return DatabaseHost::class;
17
}
18
19
/**
20
* Return database hosts with a count of databases and the node
21
* information for which it is attached.
22
*/
23
public function getWithViewDetails(): Collection
24
{
25
return $this->getBuilder()->withCount('databases')->with('node')->get();
26
}
27
}
28
29