diff --git a/app/Http/Resources/PackageResource.php b/app/Http/Resources/PackageResource.php index 7fc348d6..aec50efe 100644 --- a/app/Http/Resources/PackageResource.php +++ b/app/Http/Resources/PackageResource.php @@ -18,7 +18,7 @@ class PackageResource extends JsonResource { $originalPackingList = $this->packingList->owner instanceof PackingList ? $this->packingList->owner->owner : $this->packingList->owner; - +dd($originalPackingList); return [ 'id' => $this->id, 'type' => $this->type, diff --git a/app/Http/Resources/TransportResource.php b/app/Http/Resources/TransportResource.php index 79768074..b931964d 100644 --- a/app/Http/Resources/TransportResource.php +++ b/app/Http/Resources/TransportResource.php @@ -17,14 +17,14 @@ class TransportResource extends JsonResource { return [ 'id' => $this->id, -// 'type' => $this->type, -// 'courier' => $this->courier, -// 'tracking_number' => $this->tracking_number, -// 'dispatch_date' => $this->dispatch_date ? $this->dispatch_date->format('d-m-Y') : $this->dispatch_date, -// 'drop_date' => $this->drop_date ? $this->drop_date->format('d-m-Y') : $this->drop_date, -// 'status' => $this->status, -// 'current_schedule' => new ScheduleResource($this->schedules()->where('status', '=', ApprovalStatus::APPROVED)->first()), -// 'schedule_history' => ScheduleResource::collection($this->schedules()->where('status', '=', ApprovalStatus::EXPIRED)->get()) + 'type' => $this->type, + 'courier' => $this->courier, + 'tracking_number' => $this->tracking_number, + 'dispatch_date' => $this->dispatch_date ? $this->dispatch_date->format('d-m-Y') : $this->dispatch_date, + 'drop_date' => $this->drop_date ? $this->drop_date->format('d-m-Y') : $this->drop_date, + 'status' => $this->status, + 'current_schedule' => new ScheduleResource($this->schedules()->where('status', '=', ApprovalStatus::APPROVED)->first()), + 'schedule_history' => ScheduleResource::collection($this->schedules()->where('status', '=', ApprovalStatus::EXPIRED)->get()) ]; } }