Code sync from Shipping Portal, independent deployment of Vue Polling, Performance Improvement and tweaking for better user experience

This commit is contained in:
Dillon Ngo
2023-12-30 18:35:17 +08:00
parent 6da337b9dc
commit bf5ea2b2f2
26 changed files with 809 additions and 178 deletions
@@ -0,0 +1,31 @@
<?php
namespace App\Http\Resources;
use App\Models\Booking;
use Carbon\Carbon;
use Illuminate\Http\Resources\Json\JsonResource;
use App\Http\Resources\V2\BookingV2Resource;
use App\Http\Resources\V2\CompanyV2Resource;
class ListDocumentJobResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function toArray($request)
{
return [
'id' => $this->id,
'reference' => $this->reference,
'status' => (int) $this->status,
'document_type' => $this->document_type,
'owner' => $this->relationLoaded('owner') ? ($this->owner instanceof Booking ? new BookingV2Resource($this->owner, $this->userInfo) : new CompanyV2Resource($this->owner, $this->userInfo)) : null,
'files' => FileResource::collection($this->files),
'created_at' => Carbon::parse($this->created_at)->format('d-m-Y h:i:s A')
];
}
}