public static function build(Request $request, ArticleManager $articleManager, $date)
 {
     if ($request->has('meta') && $request->only('meta') == true) {
         return $articleManager->archives($date, ['online' => true]);
     } else {
         return $articleManager->archivesData($date, ['online' => true]);
     }
 }
 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 category($category, Request $request, ArticleManager $articleManager)
 {
     // todo: look for filters
     return $articleManager->category($category, $request->all());
 }
 function getShow(Article $article, ArticleManager $articleManager)
 {
     $articleManager->checkView($article);
     return view('articles.show')->withArticle($article);
 }