pelican-panel-banquise/app/Repositories/Eloquent/DatabaseHostRepository.php
2024-03-12 22:39:16 -04:00

28 lines
700 B
PHP

<?php
namespace App\Repositories\Eloquent;
use Illuminate\Support\Collection;
use App\Models\DatabaseHost;
use App\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();
}
}