public function hostname(Hostname $hostname = null): ?Hostname
    {
        if ($hostname !== null) {
            $this->app->instance(CurrentHostname::class, $hostname);

            $this->emitEvent(new Events\Hostnames\Switched($hostname));

            return $hostname;
        }

        return $this->app->make(CurrentHostname::class);
    }
public function hostname(Hostname $hostname = null): ?Hostname
    {
        if ($hostname !== null) {
            $this->app->instance(CurrentHostname::class, $hostname);

            $this->emitEvent(new Events\Hostnames\Switched($hostname));

            return $hostname;
        }

        return $this->app->make(CurrentHostname::class);
    }
public function hostname ( Hostname $ hostname = null ) : ? Hostname { if ( $ hostname !== null ) { $ this -> app -> instance ( CurrentHostname :: class , $ hostname ) ; $ this -> emitEvent ( new Events \ Hostnames \ Switched ( $ hostname ) ) ; return $ hostname ; } return $ this -> app -> make ( CurrentHostname :: class ) ; }
Get or set the current hostname.

@param Hostname|null $hostname
@return Hostname|null
Get or set the current hostname .