system === 'EXCHANGE') { if($this->owner_type === Transaction::class){ if($this->type === StatementTransactionOwnerType::SALES){ $referenceLink = route('booking.details', $this->owner_reference); } if($this->type === StatementTransactionOwnerType::WALLET_TOP_UP){ $referenceLink = route('wallet.details', $this->owner_reference); } } } if($this->system === 'SHIPPING_PORTAL') { if($this->owner_type === Transaction::class){ if($this->type === StatementTransactionOwnerType::SALES){ $referenceLink = 'https://izyim.cief-malaysia.com/order/show/'. $this->owner_reference; } if($this->type === StatementTransactionOwnerType::WALLET_TOP_UP){ $referenceLink = 'https://izyim.cief-malaysia.com/wallet/'. $this->owner_reference .'/details'; } } } return [ 'id' => $this->id, 'type' => $this->type, 'system' => $this->system, 'owner_type' => $this->owner_type, 'owner_id' => $this->owner_id, 'reference' => $this->owner_reference, 'reference_link' => $referenceLink, 'invoice_reference' => $this->invoice_reference, 'receipt_reference' => $this->receipt_reference, 'status' => $this->status ]; } }