visiosoft/decimal-field_type
Adds a decimal field type to PyroCMS stream forms, giving developers precise decimal input handling for currency and other values requiring fixed-point precision in their Laravel-based applications.
Architecture fit. This is not a general-purpose Laravel package — it is a Streams Platform field type addon, and its value is entirely contingent on running OpenClassify (the PyroCMS/Streams fork). It plugs into the FieldType abstraction so that a decimal field can be assigned to a Stream, rendered in the admin control panel form builder, persisted to an entry column, and rehydrated on read. If our application is Streams-driven, the fit is clean and idiomatic: one small class, a config schema, a view, and language lines, discovered via service provider. If our application is plain Laravel/Eloquent, the fit is effectively zero — we would be importing an entire CMS abstraction layer to get a numeric input, which is the wrong trade.
Integration feasibility. Mechanically trivial. composer require visiosoft/decimal-field_type, confirm auto-discovery, then attach the field to a stream either through the control panel or programmatically via the Streams migration/assignment API. The package surface is small enough to audit in an afternoon, and MIT licensing means we can fork without negotiation. The real feasibility question is not "can we install it" but "can we survive its dependency graph" — it is pinned against a specific generation of visiosoft/streams-platform, and that constraint, not the field type itself, will drive our Composer resolution.
Technical risk. Concentrated in four areas:
float anywhere in the retrieve path, whether scale/rounding is enforced on save versus only on display, and whether server-side validation (min/max/step/precision) exists or whether the HTML step attribute is doing all the work.Key questions for the maintainer (or our own fork review).
DECIMAL(p,s) or something lossy?visiosoft/streams-platform, Laravel, and PHP versions are supported, and is PHP 8.2/8.3 tested?Stack fit. Only proceed if the target application is already on OpenClassify/Streams. In that case this package is the correct shape of solution: it respects the platform's field type contract rather than bolting a custom Blade partial onto the entry form. If we are not on Streams, the recommendation is to reject the package and implement a native decimal:2 cast plus a form request with decimal validation rules — roughly a day of work, no dependency risk.
Migration path. Do not consume this from Packagist on a floating constraint. Fork it into our own namespace, vendor it via a private VCS repository, pin to an explicit tag or commit, and add a thin test suite that covers save/retrieve round-trips at boundary values (zero, negative, max scale, values exceeding scale, locale-formatted input). This converts an unmaintained third-party dependency into a first-party asset with a known owner, at a cost of perhaps two days.
Compatibility. Before committing, resolve three constraints in order: PHP version, Laravel major, and visiosoft/streams-platform version. Conflicts here are the most likely reason the integration stalls, and they are not fixable by patching the field type — they are ecosystem-level. Verify that the platform version we run still exposes the FieldType contract this package implements; Streams has evolved its field type API across major versions, and a 2023 release may target an older contract.
Sequencing.
Maintenance. Upstream is dormant; assume no fixes arrive. Our obligation is to track Streams Platform upgrades, not this package — the field type is thin and stable, but the contract it implements is not. Budget a recurring review each time the platform major-bumps, and keep the fork's diff from upstream near zero so rebasing stays cheap.
Support. No vendor, no SLA, no issue-tracker responsiveness to rely on. Internal documentation is the support model: record the precision conventions, the fork location, the patch log, and the upgrade procedure. Anyone who touches entries with decimal fields needs to know the storage contract.
Scaling. Runtime cost is negligible — a field type is a rendering and casting concern, not a hot path. The scaling risk is data-shaped, not load-shaped: precision decisions made at field-creation time propagate to every downstream consumer (reporting, exports, integrations, invoices). Get scale right once, and prefer storing in minor units or a high-scale decimal over anything that involves a float.
Failure modes to monitor.
0.30000000000000004-class artifacts in exports and invoices.Ramp-up. For a developer already fluent in Streams field types, roughly half a day to productivity. For a developer without Streams exposure, one to two days — and the learning cost is in the platform's field/assignment/entry model, not this package. The TPM takeaway: the opportunity signal here is real (decimal handling is an underserved need), but this package is a narrowly correct answer to a narrow question. Fund it as a bounded spike inside the OpenClassify context, and decline it outright anywhere else.
How can I help you explore Laravel packages today?