make sure resources return the data object #186

This commit is contained in:
Nabeel Shahzad
2018-02-10 17:34:46 -06:00
parent e57fb5a7c6
commit 21e13b6b92
13 changed files with 45 additions and 58 deletions

View File

@@ -8,17 +8,9 @@ class Subfleet extends Resource
{
public function toArray($request)
{
return [
'id' => $this->id,
'airline_id' => $this->airline_id,
'name' => $this->name,
'type' => $this->type,
'fuel_type' => $this->fuel_type,
'cargo_capacity' => $this->cargo_capacity,
'fuel_capacity' => $this->fuel_capacity,
'gross_weight' => $this->gross_weight,
$arr = parent::toArray($request);
$arr['aircraft'] = Aircraft::collection($this->aircraft);
'aircraft' => Aircraft::collection($this->aircraft),
];
return $arr;
}
}