- What does jeroennoten/laravel-format actually do?
- Laravel Format provides a configurable way to format dates, numbers, currency values, file sizes, and strings in Laravel applications. It includes built-in formatters plus support for defining your own, and it exposes Blade directives and helpers so output stays consistent across views and APIs. The package is aimed at centralizing presentation formatting instead of repeating PHP or Blade formatting logic.
- How do I install jeroennoten/laravel-format?
- Install it with Composer using composer require jeroennoten/laravel-format, then follow the package's service provider and configuration publishing steps if required. Before installing, confirm that your Laravel version matches the package's Composer constraints. The newest published release, v1.4.0, declares Laravel 5.4 support, so installation is realistic only in a legacy application already pinned to that era.
- Which Laravel versions does laravel-format support?
- The latest published release explicitly adds support for Laravel 5.4. Laravel 5.5 is plausible but unverified from the provided information, while Laravel 6 and 7 are likely to fail Composer resolution and Laravel 8 through 12 will not install. There is no evidence in the release data of a modern-framework branch.
- Can I use laravel-format with Laravel 10, 11, or 12?
- No. The package's latest release is anchored to the Laravel 5.4 era, which implies Composer constraints around illuminate/support ~5.4 and a PHP floor near 5.6.4. Against Laravel 10, 11, or 12, composer require will fail dependency resolution rather than degrade gracefully. You would need a maintained fork or a different formatting approach.
- How do I format currency with laravel-format?
- Laravel Format includes built-in formatters for currency alongside dates, numbers, file sizes, and strings. You configure formatting through the package configuration and then call the appropriate formatter, helper, or Blade directive. Because the repository README was not included in the provided context, verify the exact helper and directive names against the package source before relying on them.
- How do I create a custom formatter in laravel-format?
- The package supports defining your own formatters in addition to the built-in date, number, currency, file size, and string formatters. Custom formatters are intended to be registered through the package configuration so they can be reused consistently from helpers and Blade directives. Check the package source for the exact registration contract and method signatures before implementing one.
- Is laravel-format safe to use in production?
- Treat it as high risk for any currently supported Laravel application. The newest release targets Laravel 5.4 and implies an end-of-life PHP runtime, so the host application is likely outside vendor security support and may fail SOC 2, PCI, or ISO reviews without a documented exception. It is only realistic inside a legacy application already pinned to Laravel 5.4 or 5.5.
- Does laravel-format provide Blade directives and helpers?
- Yes. The package advertises Blade directives and helpers as part of its formatting approach, which lets you apply consistent date, number, currency, file size, and string output in views and application code. This is useful for centralizing presentation rules. Verify the exact directive syntax and helper names in the repository because they are not included in the provided excerpt.
- What should I check before adopting laravel-format in a legacy app?
- Run a short compatibility spike before committing engineering time. Resolve the package in a scratch container at your target Laravel version and record the exact Composer result, diff its composer.json constraints, search for Illuminate usage that changed after Laravel 5.4, and check whether tests and CI are still green. If Composer resolution fails, stop and only continue if you are sizing a fork.
- What are alternatives to laravel-format?
- For modern Laravel applications, prefer first-party formatting utilities, Carbon date formatting, or actively maintained formatter packages that declare support for your Laravel version. If you must stay on Laravel 5.4, consider wrapping laravel-format behind a thin first-party adapter so it can be replaced without changing call sites. A maintained internal fork is another option, but budget for the fork cost rather than assuming the vendor will ship a modern branch.