HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/vebon.komma.pro/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();
    }

}