- How do I install pelmered/filament-money-field in a Laravel application?
- Install it with Composer using composer require pelmered/filament-money-field. There is no service provider or config file to publish; the package is a single-purpose Filament form field. You then use the field class directly inside a Filament form schema, for example on a resource or a custom Livewire form. Because it depends on Filament's form API and Livewire, those must already be installed and working in your panel.
- Which Filament and Laravel versions does filament-money-field support?
- The 1.x line targets earlier Filament versions, while the 2.0 line is a ground-up rewrite that adds Filament v4 support and widens the Composer constraint to also permit Filament v5. That means one release line spans several Filament majors, so check the package's composer.json before upgrading and confirm the constraint it resolves for your pinned Filament version. Always verify against your own lockfile rather than assuming compatibility from the README.
- Does filament-money-field store amounts as integer minor units or as a decimal in the database?
- The package's intent is that amounts are handled as integer minor units (for example cents) with a separate currency, which matches how moneyphp/money represents values. However, you should not assume the field's state dehydration matches your own casts and column types without checking. Build a small form, save it, and inspect the raw database value before rolling the field out across production forms, since a silent unit mismatch is an expensive bug.
- How do I handle multiple currencies with this Filament money field?
- The field supports an amount plus currency pair, with locale-aware formatting and validation for input. Currency switching is a known interaction path where a defect was fixed in Filament v4 support, so test changing the currency on an existing record and confirm the stored minor unit and currency both update correctly. If your app only ever uses one currency, consider whether a simpler money cast outside Filament is sufficient for non-panel surfaces.
- Is filament-money-field stable enough for production use?
- The 2.0 line is currently in beta (2.0.0-beta.4 at the time of evaluation), so the API can still change between betas and there is no stated GA date. It is reasonable to pilot it on a single production-equivalent form, but avoid making it a hard dependency of your domain layer. Treat it as a view-layer convenience, with moneyphp/money or your own cast remaining the authoritative representation of monetary values.
- How do I migrate from filament-money-field 1.x to 2.0?
- Treat 2.0 as a breaking release rather than an incremental bump: the rewrite may change constructor signatures, configuration methods, and state or dehydration behaviour. Check whether the repository documents a 1.x to 2.0 migration guide, and if not, diff the source for the field class and changelog. The safe approach is to branch, rebuild one real form on the beta, verify round-trip persistence, then migrate forms one at a time instead of bumping everything at once.
- Can I use filament-money-field outside of Filament, for example in API resources or imports?
- No, the package is a Filament form component and is bound to Filament's form lifecycle and Livewire, so it offers nothing for API resources, console imports, or public-facing pages. For those surfaces use a plain money value object or a custom Eloquent cast built on moneyphp/money. Keep the field scoped to your Filament panel so your domain layer does not transitively depend on a UI package.
- How does locale-aware formatting work in the Filament money field?
- The field formats amounts for display using the Money PHP formatter together with a locale, so decimal separators, grouping, and currency symbols follow the given locale rather than being hard-coded. Input parsing is likewise locale-aware, which is helpful for users but means you should test edge cases such as different decimal separators, zero and negative amounts, and very large values. Confirm that what a user types is what ends up stored as minor units.
- What are the alternatives to filament-money-field for money in Laravel?
- The most common alternative is to skip a dedicated field and use moneyphp/money or brick/money with an Eloquent cast, then rely on Filament's existing numeric or text input plus a formatter for display. That gives you full control over parsing and dehydration at the cost of more UI code. Choose the package when you want locale-aware amount and currency input out of the box in a Filament panel; choose a cast when you need money handling across non-Filament surfaces.
- How should I test money field persistence and currency switching in my application?
- Write feature tests that create and update a record through the Filament form, then assert the raw database column values rather than only the rendered output. Cover currency changes on an existing record, zero and negative amounts, very large amounts, and different locales, since those are the paths most likely to break. Because the 2.0 line spans multiple Filament majors, also check whether the package's CI actually runs the v3, v4, and v5 combinations you care about before trusting it in production.