/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index(Request $request) { $posts = $this->postRepository->filter($request->all()); return $this->respondWithCount($posts, ['posts' => $this->postTransformer->transformCollection($posts->all())]); }