3 namespace Oxbow\Http\Controllers;
5 use Illuminate\Http\Request;
7 use Oxbow\Http\Requests;
8 use Oxbow\Http\Controllers\Controller;
9 use Oxbow\Repos\BookRepo;
10 use Oxbow\Services\ActivityService;
11 use Oxbow\Services\Facades\Activity;
13 class HomeController extends Controller
16 protected $activityService;
20 * HomeController constructor.
21 * @param ActivityService $activityService
22 * @param BookRepo $bookRepo
24 public function __construct(ActivityService $activityService, BookRepo $bookRepo)
26 $this->activityService = $activityService;
27 $this->bookRepo = $bookRepo;
32 * Display the homepage.
36 public function index()
38 $books = $this->bookRepo->getAll();
39 $activity = $this->activityService->latest();
40 return view('home', ['books' => $books, 'activity' => $activity]);