base_amount, $this->currency ); } /** * Get the display amount for features breakdown * * @return array */ public function getFeaturesBreakdownAttribute() { $features_breakdown = (array) ( $this->attributes['features_breakdown'] ?? [] ); return array_map( function ( $feature ) { if ( ! empty( $feature ) ) { $feature->display_amount = Currency::format( $feature->amount, $this->currency ); } return $feature; }, $features_breakdown ); } }