public function boot(ArticleManager $articleManager, TagManager $tagManager) { view()->composer('articles.fragments.widgets.recent', function ($view) use($articleManager) { $view->with('recentArticles', $articleManager->all(['data' => 'collection', 'take' => 5])); }); view()->composer('articles.fragments.widgets.popular', function ($view) use($articleManager) { $view->with('popularArticles', $articleManager->all(['data' => 'collection', 'take' => 5])); }); view()->composer('articles.fragments.widgets.discuss', function ($view) use($articleManager) { $view->with('discussedArticles', $articleManager->all(['data' => 'collection', 'take' => 5])); }); view()->composer('articles.fragments.widgets.views', function ($view) use($articleManager) { $view->with('viewedArticles', $articleManager->all(['order' => 'views', 'data' => 'collection', 'take' => 5])); }); view()->composer('articles.fragments.widgets.categories', function ($view) use($articleManager) { $view->with('categories', $articleManager->categories(['online' => true])); }); view()->composer('articles.fragments.widgets.tags', function ($view) use($tagManager) { $view->with('tags', $tagManager->get(['quantity' => 20])); }); }
public static function search($search, TagManager $tagManager) { return new TagCollection($tagManager->search($search, \Request::all())); }