/**
  * @param CategoryRepositoryInterface $repository
  * @param Category                    $category
  *
  * @return \Illuminate\View\View
  */
 public function show(CategoryRepositoryInterface $repository, Category $category)
 {
     $hideCategory = true;
     // used in list.
     $page = intval(Input::get('page'));
     $set = $repository->getJournals($category, $page);
     $count = $repository->countJournals($category);
     $totalSum = $repository->journalsSum($category);
     $periodSum = $repository->journalsSum($category, Session::get('start'), Session::get('end'));
     $journals = new LengthAwarePaginator($set, $count, 50, $page);
     $journals->setPath('categories/show/' . $category->id);
     return view('categories.show', compact('category', 'journals', 'hideCategory', 'totalSum', 'periodSum'));
 }