use BookStack\Repos\BookRepo;
use BookStack\Repos\ChapterRepo;
use BookStack\Repos\PageRepo;
+use Views;
class BookController extends Controller
{
*/
public function index()
{
- $books = $this->bookRepo->getAll();
- return view('books/index', ['books' => $books]);
+ $books = $this->bookRepo->getAllPaginated(10);
+ $recents = $this->signedIn ? $this->bookRepo->getRecentlyViewed(10, 0) : false;
+ return view('books/index', ['books' => $books, 'recents' => $recents]);
}
/**
public function show($slug)
{
$book = $this->bookRepo->getBySlug($slug);
+ Views::add($book);
return view('books/show', ['book' => $book, 'current' => $book]);
}