/** * Display a listing of the resource. * * @return Response */ public function index($id = 0) { if ($id) { return $this->repository->find($id); } else { return $this->repository->all(); } }