Laravel Vapor - Fix a problem at container show page showing blank

This commit is contained in:
Dillon Ngo
2024-10-10 16:46:31 +08:00
parent 0b8aea4b60
commit 21ec1a582a
2 changed files with 10 additions and 10 deletions
+9 -9
View File
@@ -19,17 +19,17 @@ class ContainerBaseResource extends JsonResource
public function toArray($request)
{
return [
// 'id' => $this->id,
// 'container_reference' => $this->reference,
// 'container_specification' => ContainerTypes::CONTAINER_SPECIFICATION[$this->container_type],
// 'container_number' => $this->container_number,
// 'seal_reference' => $this->seal_reference,
// 'loading_date' => optional($this->loading_date)->format('d-m-Y'),
// 'transport' => new TransportResource($this->transports()->first()),
'id' => $this->id,
'container_reference' => $this->reference,
'container_specification' => ContainerTypes::CONTAINER_SPECIFICATION[$this->container_type],
'container_number' => $this->container_number,
'seal_reference' => $this->seal_reference,
'loading_date' => optional($this->loading_date)->format('d-m-Y'),
'transport' => new TransportResource($this->transports()->first()),
// 'packages_count' => $this->packages()->where('packages.type', '!=', 2)->sum('quantity'),
// 'total_cbm' => $this->packages()->sum(DB::raw('(width/100) * (height/100) * (length/100) * quantity')),
// 'remarks' => RemarkResource::collection($this->remarks),
// 'status' => $this->status,
'remarks' => RemarkResource::collection($this->remarks),
'status' => $this->status,
'packing_lists' => $this->shouldIncludePackingListData($request) ? $this->getSortedPackingLists() : null,
];
}
@@ -128,7 +128,7 @@
<div class="col-md-6">
<div class="card mb-3">
<div class="card-body d-flex justify-content-between align-items-center">
<span>Feedback</span>
<span>feedback.xls</span>
<open-link-in-new-tab-component custom-class="btn btn-primary" :url="route('feedback.export')" :is-url-protected="true">
<i class="fa fa-download"></i> Download
</open-link-in-new-tab-component>