/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $posts = $this->repository->latest()->paginate(5); return view('posts/index', compact('posts')); }