Added Popular books list with relevant tests

This commit is contained in:
Dan Brown
2015-12-02 20:22:41 +00:00
parent 9f435553dc
commit f1c2866fbc
7 changed files with 117 additions and 8 deletions

View File

@ -42,8 +42,9 @@ class BookController extends Controller
public function index()
{
$books = $this->bookRepo->getAllPaginated(10);
$recents = $this->signedIn ? $this->bookRepo->getRecentlyViewed(10, 0) : false;
return view('books/index', ['books' => $books, 'recents' => $recents]);
$recents = $this->signedIn ? $this->bookRepo->getRecentlyViewed(4, 0) : false;
$popular = $this->bookRepo->getPopular(4, 0);
return view('books/index', ['books' => $books, 'recents' => $recents, 'popular' => $popular]);
}
/**