private function composePoll() { view()->composer('_shared._poll', function ($view) { $view->with('poll', \App\Poll::with('options')->orderByRaw('RAND()')->where('active', 1)->first()); }); }