From 6f05dd6c869fb2baad98e956bc3899e53e3a6be7 Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Tue, 31 Mar 2020 23:32:50 -0400 Subject: [PATCH] Add full user response to PIREP API call --- app/Http/Resources/Pirep.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/app/Http/Resources/Pirep.php b/app/Http/Resources/Pirep.php index ab22c247..5c3afd8e 100644 --- a/app/Http/Resources/Pirep.php +++ b/app/Http/Resources/Pirep.php @@ -69,13 +69,7 @@ class Pirep extends Resource $res['position'] = Acars::make($this->whenLoaded('position')); $res['comments'] = PirepComment::make($this->whenLoaded('comments')); - $res['user'] = [ - 'id' => $this->user->id, - 'name' => $this->user->name, - 'avatar' => $this->user->resolveAvatarUrl(), - 'home_airport_id' => $this->user->home_airport_id, - 'curr_airport_id' => $this->user->curr_airport_id, - ]; + $res['user'] = User::make($this->whenLoaded('user')); $res['flight'] = Flight::make($this->whenLoaded('flight'));