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.
29 public function index()
31 $activity = Activity::latest(10);
32 $recents = $this->signedIn ? Views::getUserRecentlyViewed(12, 0) : $this->entityRepo->getRecentlyCreatedBooks(10);
33 $recentlyCreatedPages = $this->entityRepo->getRecentlyCreatedPages(5);
34 $recentlyUpdatedPages = $this->entityRepo->getRecentlyUpdatedPages(5);
36 'activity' => $activity,
37 'recents' => $recents,
38 'recentlyCreatedPages' => $recentlyCreatedPages,
39 'recentlyUpdatedPages' => $recentlyUpdatedPages