src/Providers/RequestMacros.php
/**
     * True if the we have a subdomain.
     *
     * @return void
     */
True if the we have a subdomain.
@return void
True if the we have a subdomain . @return void
public function hasSubdomain()
    {
        Request::macro(
            'hasSubdomain', function () {
                $host = $this->getHost();
                $appUrl = config('app.url');
                return substr_count($host, '.') > substr_count($appUrl, '.');
            }
        );
    }
public function hasSubdomain ( ) { Request :: macro ( 'hasSubdomain' , function ( ) { $ host = $ this -> getHost ( ) ; $ appUrl = config ( 'app.url' ) ; return substr_count ( $ host , '.' ) > substr_count ( $ appUrl , '.' ) ; } ) ; }
True if the we have a subdomain.
True if the we have a subdomain .
// Get host // app URL // Assumptions // localhost - has no subdomains, // so in something.local something is a subdomain // localhost.local - is two parts // so in somethings.localhost.local, somethithins is a subdomain