Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Absolute Percent Value Bundle Laravel Package

assoconnect/absolute-percent-value-bundle

Symfony bundle that adds an AbsolutePercentValue field/type to handle percentage inputs safely, normalizing values and enabling comparisons, calculations, and validation without sign/format issues. Useful for forms and domain models needing absolute percentage values.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Dynamic Pricing & Discounts: Enables flexible pricing models (e.g., tiered discounts, percentage-based promotions) without hardcoding values, reducing backend complexity.
  • A/B Testing & Experimentation: Facilitates rapid iteration on pricing strategies (e.g., "20% off vs. $X off") by abstracting value calculations from business logic.
  • Multi-Currency & Localization: Simplifies handling absolute/percentage values across regions (e.g., "15% off" vs. "€10 off") with minimal code changes.
  • Cost Optimization: Avoids reinventing value conversion logic (e.g., 50% of $100 = $50), accelerating feature delivery.
  • Roadmap Prioritization: Justifies "buy vs. build" for teams lacking time/resources to develop robust value-calculation utilities.
  • Compliance & Auditing: Standardizes value formatting (e.g., tax calculations, refunds) to meet regulatory requirements.

When to Consider This Package

  • Avoid if:
    • Your use case requires complex financial math (e.g., compound interest, multi-tiered taxes) beyond basic absolute/percentage conversions.
    • You need real-time dependency injection (e.g., fetching dynamic rates from external APIs) and the package lacks extensibility hooks.
    • Your team prefers framework-agnostic solutions (e.g., JavaScript/TypeScript) for frontend pricing logic.
    • The package’s MIT license conflicts with your organization’s open-source policy (though rare, some enterprises restrict permissive licenses).
  • Look elsewhere if:
    • You’re using Symfony (this is Laravel-specific; consider symfony/options-resolver or moneyphp/money).
    • You need advanced validation (e.g., ensuring percentages don’t exceed 100%)—pair with Laravel’s built-in validators or a dedicated package like spatie/laravel-validation-extensions.
    • Your stack is headless (e.g., API-only) and you lack a Laravel backend.

How to Pitch It (Stakeholders)

For Executives: "This package lets us ship pricing features faster—like dynamic discounts or multi-currency promotions—without hiring extra devs. It’s like a plug-and-play calculator for ‘X% off’ or ‘$Y off’ scenarios, reducing bugs and speeding up A/B tests. MIT-licensed and Laravel-native, so it integrates seamlessly with our stack. Minimal risk: if it doesn’t fit, we can replace it in a week."

For Engineering: *"The AbsolutePercentValueBundle handles the boilerplate of converting between absolute ($X) and percentage (X%) values in Laravel. Key benefits:

  • 10 lines of code to implement tiered discounts (e.g., ‘10% off > $50’).
  • Type-safe with PHP 8+ support (assuming the package follows modern standards).
  • Testable: Isolates value logic from business rules. Tradeoff: Lightweight but not a full financial library—pair with Laravel’s validation for edge cases. Let’s prototype a discount feature to validate."*
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor