mirror of
				https://github.com/pelican-dev/panel.git
				synced 2025-11-04 16:46:51 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			32 lines
		
	
	
		
			798 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			798 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.
 | 
						|
     *
 | 
						|
     * @return string
 | 
						|
     */
 | 
						|
    public function model()
 | 
						|
    {
 | 
						|
        return DatabaseHost::class;
 | 
						|
    }
 | 
						|
 | 
						|
    /**
 | 
						|
     * Return database hosts with a count of databases and the node
 | 
						|
     * information for which it is attached.
 | 
						|
     *
 | 
						|
     * @return \Illuminate\Support\Collection
 | 
						|
     */
 | 
						|
    public function getWithViewDetails(): Collection
 | 
						|
    {
 | 
						|
        return $this->getBuilder()->withCount('databases')->with('node')->get();
 | 
						|
    }
 | 
						|
}
 |