fix billing page

This commit is contained in:
omair saleh
2022-03-02 02:24:54 +08:00
parent 76f426a24c
commit 07d1bbd921
8 changed files with 130 additions and 62 deletions
+2 -1
View File
@@ -2,6 +2,7 @@
namespace App\Http\Resources;
use App\Models\Booking;
use App\Models\Company;
use App\Models\Document;
use Carbon\Carbon;
@@ -23,7 +24,7 @@ class DocumentResource extends JsonResource
'reference' => $this->reference,
'status' => (int) $this->status,
'document_type' => $this->document_type,
'owner' => new CompanyResource($this->whenLoaded('owner')),
'owner' => $this->relationLoaded('owner') ? ($this->owner instanceof Booking ? new BookingResource($this->owner) : new CompanyResource($this->owner)) : null,
'files' => FileResource::collection($this->files),
'created_at' => Carbon::parse($this->created_at)->format('d-m-Y h:i:s A')
];