protected function bootAdministratorViewComposer()
    {
        view()->composer('administrator.widgets.*', function (View $view) {
            /** @var \Yajra\CMS\Themes\Repositories\Repository $themes */
            $themes    = $this->app['themes'];
            $theme     = $themes->current();
            $positions = $theme->positions;
            $data      = [];
            foreach ($positions as $position) {
                $data[$position] = Str::title($position);
            }

            $view->with('widget_positions', $data);
            $view->with('theme', $theme);

            /** @var \Yajra\CMS\Repositories\Extension\Repository $extensions */
            $extensions = $this->app['extensions'];
            $widgets    = $extensions->allWidgets()->filter(function ($extension) {
                return $extension->enabled;
            });
            $view->with('extensions', $widgets);
        });

        view()->composer(['administrator.partials.permissions'], function (View $view) {
            $view->with('permissions', Permission::orderBy('resource')->get());
        });
    }
protected function bootAdministratorViewComposer()
    {
        view()->composer('administrator.widgets.*', function (View $view) {
            /** @var \Yajra\CMS\Themes\Repositories\Repository $themes */
            $themes    = $this->app['themes'];
            $theme     = $themes->current();
            $positions = $theme->positions;
            $data      = [];
            foreach ($positions as $position) {
                $data[$position] = Str::title($position);
            }

            $view->with('widget_positions', $data);
            $view->with('theme', $theme);

            /** @var \Yajra\CMS\Repositories\Extension\Repository $extensions */
            $extensions = $this->app['extensions'];
            $widgets    = $extensions->allWidgets()->filter(function ($extension) {
                return $extension->enabled;
            });
            $view->with('extensions', $widgets);
        });

        view()->composer(['administrator.partials.permissions'], function (View $view) {
            $view->with('permissions', Permission::orderBy('resource')->get());
        });
    }
protected function bootAdministratorViewComposer ( ) { view ( ) -> composer ( 'administrator.widgets.*' , function ( View $ view ) { /** @var \Yajra\CMS\Themes\Repositories\Repository $themes */ $ themes = $ this -> app [ 'themes' ] ; $ theme = $ themes -> current ( ) ; $ positions = $ theme -> positions ; $ data = [ ] ; foreach ( $ positions as $ position ) { $ data [ $ position ] = Str :: title ( $ position ) ; } $ view -> with ( 'widget_positions' , $ data ) ; $ view -> with ( 'theme' , $ theme ) ; /** @var \Yajra\CMS\Repositories\Extension\Repository $extensions */ $ extensions = $ this -> app [ 'extensions' ] ; $ widgets = $ extensions -> allWidgets ( ) -> filter ( function ( $ extension ) { return $ extension -> enabled ; } ) ; $ view -> with ( 'extensions' , $ widgets ) ; } ) ; view ( ) -> composer ( [ 'administrator.partials.permissions' ] , function ( View $ view ) { $ view -> with ( 'permissions' , Permission :: orderBy ( 'resource' ) -> get ( ) ) ; } ) ; }
Register administrator view composers.
Register administrator view composers .