2015-08-16 15:11:21 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Oxbow\Http\Controllers;
|
|
|
|
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
|
|
|
|
use Oxbow\Http\Requests;
|
|
|
|
use Oxbow\Http\Controllers\Controller;
|
|
|
|
use Oxbow\Repos\BookRepo;
|
|
|
|
use Oxbow\Services\ActivityService;
|
|
|
|
use Oxbow\Services\Facades\Activity;
|
|
|
|
|
|
|
|
class HomeController extends Controller
|
|
|
|
{
|
|
|
|
|
|
|
|
protected $activityService;
|
|
|
|
protected $bookRepo;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* HomeController constructor.
|
|
|
|
* @param ActivityService $activityService
|
2015-08-29 10:03:42 -04:00
|
|
|
* @param BookRepo $bookRepo
|
2015-08-16 15:11:21 -04:00
|
|
|
*/
|
|
|
|
public function __construct(ActivityService $activityService, BookRepo $bookRepo)
|
|
|
|
{
|
|
|
|
$this->activityService = $activityService;
|
|
|
|
$this->bookRepo = $bookRepo;
|
2015-08-29 10:03:42 -04:00
|
|
|
parent::__construct();
|
2015-08-16 15:11:21 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Display the homepage.
|
|
|
|
*
|
|
|
|
* @return Response
|
|
|
|
*/
|
|
|
|
public function index()
|
|
|
|
{
|
|
|
|
$books = $this->bookRepo->getAll();
|
|
|
|
$activity = $this->activityService->latest();
|
|
|
|
return view('home', ['books' => $books, 'activity' => $activity]);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|