- What does epigra/laravel-int actually do?
- It is a thin convenience layer over PHP's intl extension for Laravel, exposing locale-aware formatting such as numbers, currency, dates and times, and ICU message formatting through a service provider, facade and/or global helpers. The package is a presentation and formatting utility, not a translation management system. It does not store translations, manage language files, or replace tools like laravel-lang or spatie/laravel-translatable. Treat it as a helper for turning values into locale-correct display strings.
- How do I install epigra/laravel-int in a Laravel application?
- Installation is a standard Composer require of epigra/laravel-int, and Laravel package auto-discovery registers the service provider automatically. If the package ships a config file you can publish it with the vendor:publish command, but the defaults should work for most projects. The main prerequisite is that the PHP intl extension is enabled in every environment. There is no database migration or queue worker involved.
- Does epigra/laravel-int require the PHP intl extension?
- Yes. The package builds on PHP's intl extension and its underlying ICU libraries, so intl must be compiled and enabled in local, CI, container and production images. Ensure the intl version and ICU data are consistent across environments, because formatting output can differ between ICU versions. If intl is already a hard requirement of other dependencies such as money or phone packages, this adds no new environmental cost. Verify ICU data is present in minimal Docker images, where it is sometimes stripped out.
- Which Laravel and PHP versions does epigra/laravel-int support?
- There is no documented Laravel version support matrix in the package overview, so check the require constraints in its composer.json before committing. Look for a CI matrix proving the package is tested against the Laravel and PHP versions you actually run. Because the package is small, a one-day spike on your target version is usually enough to confirm compatibility. If you rely on a Laravel major version that postdates the last release, expect to verify or patch it yourself.
- Is epigra/laravel-int a replacement for laravel-lang or spatie/laravel-translatable?
- No. Those packages deal with translation management, language files and translatable model attributes, while epigra/laravel-int focuses on formatting values for a given locale. They solve different problems and can be used together in the same application. Use your translation tooling to supply the strings and this package to render numbers, dates and messages correctly for each locale. Do not expect it to handle translation storage or a translation CMS workflow.
- How should I test code that uses epigra/laravel-int?
- Wrap the package behind an application-owned interface such as a Formatter contract with number, currency and date methods, then resolve that interface from the container in your tests. This lets you fake formatting in unit tests and keep assertions focused on business logic. Add a smaller set of integration tests that assert real formatted output for representative locales, including edge cases like ar, hi-IN, de-CH and right-to-left scripts. Also test locale fallback behavior and what happens when an invalid locale is supplied. Run these tests in CI with the same intl and ICU versions as production.
- Is epigra/laravel-int safe to use in production?
- The security exposure is inherently low: the package performs no network I/O, no deserialization and exposes no authentication surface, so the risk is breakage and drift rather than compromise. The larger concern is project maturity, since the package has minimal community validation and a single-maintainer abandonment risk. Pin the version in composer.json and isolate it behind an internal formatter contract so you can swap or replace it later. Never persist its formatted output as a canonical stored value; keep raw values in the database and format only at render time.
- How does epigra/laravel-int handle locale detection and fallback?
- Based on its design as a thin intl wrapper, it most likely formats using the current application locale from App::getLocale rather than performing its own Accept-Language negotiation. That means you should resolve the request locale yourself, for example with middleware that maps Accept-Language to a supported locale and a fallback. Confirm in the source whether an invalid locale or missing ICU data throws an exception or silently falls back, since that changes your error handling. Document the chosen behavior in your application so formatting never fails silently in user-facing output.
- Is epigra/laravel-int actively maintained and what license does it use?
- The repository shows very little community signal, with no stars or dependents, which suggests a single maintainer and an uncertain release cadence. Check the commit history over the last twelve months and read the LICENSE file in the repository root before adopting. Plan for the possibility that you inherit maintenance, including Laravel major-version compatibility updates. If that is unacceptable, the package is small enough that reimplementing the helpers you need over intl is realistic.
- What are the alternatives to epigra/laravel-int?
- You can call PHP's intl classes directly, using NumberFormatter, IntlDateFormatter and MessageFormatter, which gives full control with no extra dependency. Laravel-focused packages such as money or phone libraries cover specific formatting domains, and Carbon handles localized date formatting for many cases. A small in-house formatter service behind your own interface is often the most predictable option for a handful of formatting needs. Compare the feature surface you actually require, especially locale negotiation and edge-locale behavior, before adding a dependency.