protected function setupEventListening(Container $app)
    {
        $app['events']->listen('content.rendering', function (View $view) use ($app) {
            if ($viewData = array_merge($view->getFactory()->getShared(), $view->getData())) {
                $decorator = $app['autopresenter'];
                foreach ($viewData as $key => $value) {
                    $view[$key] = $decorator->decorate($value);
                }
            }
        });
    }
protected function setupEventListening(Container $app)
    {
        $app['events']->listen('content.rendering', function (View $view) use ($app) {
            if ($viewData = array_merge($view->getFactory()->getShared(), $view->getData())) {
                $decorator = $app['autopresenter'];
                foreach ($viewData as $key => $value) {
                    $view[$key] = $decorator->decorate($value);
                }
            }
        });
    }
protected function setupEventListening ( Container $ app ) { $ app [ 'events' ] -> listen ( 'content.rendering' , function ( View $ view ) use ( $ app ) { if ( $ viewData = array_merge ( $ view -> getFactory ( ) -> getShared ( ) , $ view -> getData ( ) ) ) { $ decorator = $ app [ 'autopresenter' ] ; foreach ( $ viewData as $ key => $ value ) { $ view [ $ key ] = $ decorator -> decorate ( $ value ) ; } } } ) ; }
Setup the event listening.

Every time the event fires, decorate the bound data.

@param \Illuminate\Contracts\Container\Container $app

@return void
Setup the event listening .