type === TransactionType::TOP_UP) { $reference = $this->owner->owner->inviters()->withPivot('invitee_reference')->first()->pivot->invitee_reference; } if($this->type === TransactionType::PAYMENT && $this->owner_type !== Wallet::class){ $reference = $this->owner->owner->owner->reference; } return [ 'status' => 'success', 'system' => 'SHIPPING_PORTAL', 'type' => $this->type, 'owner_type' => Transaction::class, 'owner_id'=> $this->id, 'owner_reference'=> $reference, 'created_at'=> $this->created_at, // invoice date ]; } }