protected function loadGlobalViewVariables(Config $config)
    {
        $app = app();
        $share = [];

        foreach ($config->get('globalviewvars') as $name => $abstract) {
            $share[$name] = $app->make($abstract);
        }

        $this->share($share);

        if (method_exists($this, 'loadExtraGlobalViewVariables')) {
            $this->loadExtraGlobalViewVariables();
        }
    }
protected function loadGlobalViewVariables(Config $config)
    {
        $app = app();
        $share = [];

        foreach ($config->get('globalviewvars') as $name => $abstract) {
            $share[$name] = $app->make($abstract);
        }

        $this->share($share);

        if (method_exists($this, 'loadExtraGlobalViewVariables')) {
            $this->loadExtraGlobalViewVariables();
        }
    }
protected function loadGlobalViewVariables ( Config $ config ) { $ app = app ( ) ; $ share = [ ] ; foreach ( $ config -> get ( 'globalviewvars' ) as $ name => $ abstract ) { $ share [ $ name ] = $ app -> make ( $ abstract ) ; } $ this -> share ( $ share ) ; if ( method_exists ( $ this , 'loadExtraGlobalViewVariables' ) ) { $ this -> loadExtraGlobalViewVariables ( ) ; } }
Load global variables available in all views

@param \Illuminate\Contracts\Config\Repository       $config
Load global variables available in all views