Update response objects

This commit is contained in:
Nabeel Shahzad
2020-03-31 17:26:55 -04:00
parent 819d3bcb47
commit d1d243ef06
4 changed files with 19 additions and 12 deletions

View File

@@ -119,11 +119,15 @@ class AcarsController extends Controller
public function acars_get($id, Request $request)
{
$this->pirepRepo->find($id);
$acars = Acars::with(['pirep'])
->where([
'pirep_id' => $id,
'type' => AcarsType::FLIGHT_PATH,
])
->orderBy('sim_time', 'asc')
->get();
return new AcarsRouteResource(Acars::where([
'pirep_id' => $id,
'type' => AcarsType::FLIGHT_PATH,
])->orderBy('sim_time', 'asc')->get());
return new AcarsRouteResource($acars);
}
/**