File: D:/HostingSpaces/SBogers85/equichecker.com/app/KommaApp/Domains/Domain.php
<?php
namespace KommaApp\Domains;
use KommaApp\Domains\Models\Domain as DomainModel;
class Domain
{
protected $domain;
protected $defaultLanguage = 'nl';
public function __construct()
{
switch (\Request::server('HTTP_HOST')) {
/*Domain switcher*/
default:
$domain ='site.komma.pro';
}
$this->domain = DomainModel::Where('domain', '=', $domain)->with('country')->first();
}
/**
* This method returns the domain string
*
* @return Domain string
*/
public function get()
{
return $this->domain->domain;
}
public function getCountry($field = 'iso_2')
{
return $this->domain->country->$field;
}
public function getLinkedDomains()
{
$linkedDomains = [];
return $linkedDomains ;
}
function getDomain($domain)
{
return DomainModel::Where('domain', '=', $domain)->with('country')->first();
}
}