X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/732f3a99863115caa1b80a844ce8b07cb700a50e..refs/pull/63/head:/app/Http/Controllers/HomeController.php diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index ad87188b7..8fd1c1009 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -1,14 +1,13 @@ activityService = $activityService; $this->bookRepo = $bookRepo; + parent::__construct(); } @@ -35,9 +33,9 @@ class HomeController extends Controller */ public function index() { - $books = $this->bookRepo->getAll(); - $activity = $this->activityService->latest(); - return view('home', ['books' => $books, 'activity' => $activity]); + $activity = Activity::latest(); + $recents = $this->signedIn ? Views::getUserRecentlyViewed(10, 0) : $this->bookRepo->getLatest(10); + return view('home', ['activity' => $activity, 'recents' => $recents]); } }