* Ensure 'fields' field is return as an object for flights #618 * Eager loading for flight fields
This commit is contained in:
@@ -88,7 +88,15 @@ class FlightController extends Controller
|
||||
$this->flightRepo->pushCriteria(new WhereCriteria($request, $where));
|
||||
$this->flightRepo->pushCriteria(new RequestCriteria($request));
|
||||
|
||||
$flights = $this->flightRepo->paginate();
|
||||
$flights = $this->flightRepo
|
||||
->with([
|
||||
'airline',
|
||||
'subfleets',
|
||||
'subfleets.aircraft',
|
||||
'subfleets.fares',
|
||||
'field_values',
|
||||
])
|
||||
->paginate();
|
||||
} catch (RepositoryException $e) {
|
||||
return response($e, 503);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user