Compose the view.

@param  \Illuminate\Contracts\View\View  $view
517279
public function compose(View $view)
    {
        $archives = Post::published()->get()->groupBy(function (Post $post) {
            return $post->published_at->year;
        });

        $view->with('archivesWidgetItems', $archives);
    }
575019
public function compose(View $view)
    {
        $data = $view->getData();
        $view->with([
            'projectRefList' => $this->getRefList($data[ 'project' ]),
            'projectsList'   => $this->getProjectList(),
            'projectName'    => $data[ 'project' ]->getName(),
            'projectRef'            => $data[ 'project' ]->getRef()
        ]);
    }
190346
public function compose(View $view)
    {
        $menu = \Menu::getMenu('adminMenu');

        $menu->link('admin.dashboard', function (Link $link) {
            $link->name = 'Admin Dashboard';
            $link->url  = route('admin.index');
        });
        $menu->link('admin.artisan', function (Link $link) {
            $link->name = 'Artisan';
            $link->url  = route('admin.artisan.index');
        });
        $menu->dropDown('admin.users', 'Users', function (DropDown $dropDown) {
            $dropDown->link('admin.users.index', function (Link $link) {
                $link->name = 'List Users';
                $link->url  = route('admin.users.index');
            });
            $dropDown->link('admin.users.create', function (Link $link) {
                $link->name = 'Add User';
                $link->url  = route('admin.users.create');
            });
        });
    }
7330
public function setView($view, $variables = [])
    {
        if (!empty($variables)) {
            $this->with($variables);
        }

        $this->view = $view;
    }
215183
public function compose(View $view)
    {
        $character_info = CharacterInfo::find($this->request->character_id);

        if (! is_null($character_info))
            $view->with('character_name', $character_info->name);

        $user = User::find($this->request->character_id);

        if (! isset($user->refresh_token)){
            $deleted_at = $user->refresh_token()->withTrashed()->first()->deleted_at;
            redirect()->back()->with('warning', trans('web::seat.deleted_refresh_token', ['time' => human_diff($deleted_at)]));
        }
    }
211935
public function compose(View $view)
    {
        $categories = Category::with('posts')
            ->whereHas('posts', function (Builder $b) {
                // TODO: Try to export this code with model's scope ?
                $b->where('is_draft', false)
                  ->where('published_at', '<=', Carbon::now());
            })
            ->get()
            ->sortByDesc(function(Category $category) {
                return $category->posts->count();
            });

        $view->with('categoriesWidgetItems', $categories);
    }
1013510
public static function setView($view)
    {
        if (count(self::$execContexts)) {
            self::$execContexts[count(self::$execContexts) - 1]['view'] = $view;
        }
    }
165290
public function compose(View $view)
    {
        $corporation_info = CorporationInfo::find($this->request->corporation_id);

        if (! is_null($corporation_info))
            $view->with('corporation_name', $corporation_info->name);
    }
1084897
public function compose(View $view)
    {
        if ($this->overwriteDisabled($view)) {
            return $view;
        }

        $this->currentPath = collect(explode('/views/', $view->getPath()))->last();

        if (\View::exists($this->getNewView())) {
            $view->setPath($this->getNewPath());
        }

        return $view;
    }
847978
public function add(View $view)
    {
        // Append to the stack.
        $this->stack->append($view);

        if ($view->getType() === View::PART_BODY_PLACEHOLDER) {
            $this->bodyKey = (count($this->stack) - 1);
        }

        return count($this->stack);
    }
1150364
public function view($view = null, $layout = null)
    {
        if (! is_null($layout)) {
            $this->layoutOptions = [
                'default' => $layout,
                'ajax'    => $layout,
            ];
        }

        // Set up the default view resolution
        viewBuilder()->setUp($this->layoutOptions, $view);
        $this->setupLayout();
    }
997950
public function composeWithAllRouteNames(View $view)
    {
        $routes = $this->getAllRouteNames();

        foreach ($routes as $action => $routeName) {
            $view->with("{$action}Route", $routeName);
        }
    }
577453
public function compose(View $view)
    {
        $view->withComponentCount($this->componentCount);
        $view->withIncidentCount($this->incidentCount);
        $view->withIncidentTemplateCount($this->incidentTemplateCount);
        $view->withScheduleCount($this->scheduleCount);
        $view->withSubscriberCount($this->subscriberCount);
        $view->withIsWriteable(is_writable(app()->bootstrapPath().'/cachet'));
    }
1180172
protected function setView()
    {
        $views = [
            $this->controller,
            $this->action,
        ];

        $this->view = implode('.', array_filter($views));
    }
377622
public function compose(View $view)
    {
        $userGroupRepository = app(UserGroupInterface::class);
        $userGroupOptions = $userGroupRepository->all()->pluck('name', 'id');
        $view->with('userGroupOptions', $userGroupOptions);
    }
1040841
public function compose(View $view)
    {
        $tags = Tag::with('posts')
            ->whereHas('posts', function (Builder $b) {
                // TODO: Try to export this code with model's scope ?
                $b->where('is_draft', false)
                  ->where('published_at', '<=', Carbon::now());
            })
            ->get()
            ->sortByDesc(function($tag) {
                return $tag->posts->count();
            });

        $view->with('tagsWidgetItems', $tags);
    }
214927
public function bind($js)
    {
        foreach ($this->views as $view) {
            $this->event->listen("composing: {$view}", function () use ($js) {
                echo "<script>{$js}</script>";
            });
        }
    }