Update response objects
This commit is contained in:
@@ -6,6 +6,9 @@ use App\Contracts\Resource;
|
||||
use App\Support\Units\Distance;
|
||||
use App\Support\Units\Fuel;
|
||||
|
||||
/**
|
||||
* @mixin \App\Models\Acars
|
||||
*/
|
||||
class Acars extends Resource
|
||||
{
|
||||
/**
|
||||
@@ -31,6 +34,8 @@ class Acars extends Resource
|
||||
$fuel = new Fuel($fuel, config('phpvms.internal_units.fuel'));
|
||||
$res['fuel'] = $fuel->getResponseUnits();
|
||||
|
||||
$res['pirep'] = Pirep::make($this->whenLoaded('pirep'));
|
||||
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,8 +67,8 @@ class Pirep extends Resource
|
||||
$res['dpt_airport'] = new Airport($this->dpt_airport);
|
||||
$res['arr_airport'] = new Airport($this->arr_airport);
|
||||
|
||||
$res['position'] = new Acars($this->position);
|
||||
$res['comments'] = PirepComment::collection($this->comments);
|
||||
$res['position'] = Acars::make($this->whenLoaded('position'));
|
||||
$res['comments'] = PirepComment::make($this->whenLoaded('comments'));
|
||||
$res['user'] = [
|
||||
'id' => $this->user->id,
|
||||
'name' => $this->user->name,
|
||||
|
||||
Reference in New Issue
Block a user