3 namespace BookStack\Http\Controllers;
6 use BookStack\Repos\EntityRepo;
7 use BookStack\Http\Requests;
10 class HomeController extends Controller
12 protected $entityRepo;
15 * HomeController constructor.
16 * @param EntityRepo $entityRepo
18 public function __construct(EntityRepo $entityRepo)
20 $this->entityRepo = $entityRepo;
21 parent::__construct();
26 * Display the homepage.
30 public function index()
32 $activity = Activity::latest(10);
33 $recents = $this->signedIn ? Views::getUserRecentlyViewed(12, 0) : $this->entityRepo->getRecentlyCreatedBooks(10);
34 $recentlyCreatedPages = $this->entityRepo->getRecentlyCreatedPages(5);
35 $recentlyUpdatedPages = $this->entityRepo->getRecentlyUpdatedPages(5);
37 'activity' => $activity,
38 'recents' => $recents,
39 'recentlyCreatedPages' => $recentlyCreatedPages,
40 'recentlyUpdatedPages' => $recentlyUpdatedPages