flightRepo = $flightRepo; } public function get($id) { $flight = $this->flightRepo->find($id); return fractal($flight, new FlightTransformer())->respond(); } public function search(Request $request) { $flights = $this->flightRepo->searchCriteria($request)->paginate(); return fractal($flights, new FlightTransformer())->respond(); } }