lastdragon-ru/lara-asp-formatter
Intl extension (ICU) for robust, locale-aware formatting (numbers, dates, currencies, etc.), aligning with Laravel’s internationalization (i18n) ecosystem.config/asp-formatter.php.FormatterService, Helper, or Facade?).Intl: Requires the extension to be enabled (intl PHP module), which may not be enabled by default in all hosting environments (e.g., shared hosting).HEAD for ^13.10.0). This could lead to compatibility issues in greenfield projects.Str::of() chains or NumberFormatter instances) would need refactoring.intl is missing (though Laravel’s composer.json could enforce this as a dev requirement).Intl is generally performant, but custom formats could introduce overhead if overused (e.g., parsing complex regex patterns at runtime).symfony/intl, carbon) that could be replaced or augmented?intl extension enabled in production/staging environments?NumberFormatter or IntlDateFormatter suffice, or is the wrapper’s convenience worth the risk?Intl or needing a centralized formatting layer (e.g., replacing scattered NumberFormatter instances).intl extension (would require server-level changes).moneyphp/money, league/iso3166) that already handle currency/locale logic.Str::of($value)->slug(), NumberFormatter::format()).NumberFormatter instances with the wrapper to validate performance/behavior.Intl usage with the wrapper’s facade/service.config/asp-formatter.php:
'formats' => [
'currency' => '¤ #,##0.00',
'percentage' => '#,##0 %',
'custom_date' => "EEEE, MMMM d, yyyy",
],
{{ AspFormatter::format('currency', 1234.56, 'en_US') }}
^8.0).AspFormatter) and binds the formatter service to the container.php -m | grep intl).Intl-related packages (e.g., symfony/intl).intl extension (if not already enabled).composer.json to pin Laravel/PHP versions to supported ranges.composer require lastdragon-ru/lara-asp-formatter
php artisan vendor:publish --provider="LastDragon\AspFormatter\AspFormatterServiceProvider"
config/asp-formatter.php.en_US, de_DE, ar_SA).Intl updates (e.g., new locale data) without code changes.Intl docs provide fallback support for format patterns.Intl behavior.intl or unsupported formats (e.g., graceful degradation).Intl is optimized for formatting; the wrapper adds minimal abstraction.Intl is stateless).| Failure Scenario | Impact | Mitigation | |--------------------------------|
How can I help you explore Laravel packages today?