itiden/nova-file-size-field
A simple Laravel Nova field that displays file sizes in a human-readable format. Drop it into your resource to automatically convert raw byte values into KB, MB or GB, keeping index and detail views clean and easy to scan.
Architecture fit
itiden/nova-file-size-field is a presentation-layer extension for Laravel Nova: a single custom field that renders a human-readable file size (bytes → KB/MB/GB) instead of a raw integer. Architecturally it is a leaf dependency — it touches no models, migrations, service providers of consequence, or request lifecycle hooks. That makes it low-risk to adopt and equally low-risk to remove. The 1.0.3 release does not change this posture; it is a compatibility fix, not new capability.
Integration feasibility
High. Adoption is a composer require plus one line in a Nova resource's fields() method. No schema change, no data migration, no queue or config surface. The 1.0.3 change (PHP 8.1 compatibility, contributed via PR #5) removes what was likely the main blocker for teams on modern PHP runtimes — previously the package would have failed composer install or emitted runtime deprecations under 8.1. This release is best read as "unblocks adoption on PHP 8.1," not "adds value."
Technical risk
Component contract). A 1.0.x line most plausibly targets Nova 3.x. Confirm the target Nova major explicitly before planning around it; Nova 4 projects may need a different field entirely.Key questions
stat() per row on index views, and does it work against S3/remote disks?^8.1 only, or does it still admit 8.0?Stack fit
Fits any Laravel + Nova application storing file sizes as integers (bytes) alongside uploads. It is a UI convenience, so it substitutes cleanly for an existing Number or Text field displaying raw bytes. If the team already formats sizes in an accessor or Vue component, this package is redundant.
Migration path
^1.0.3 in composer.json; verify resolution against the project's PHP and Nova constraints in a scratch branch first.composer remove; no state to unwind.Compatibility Gate on three axes before merging: PHP version (8.1 confirmed; 8.2/8.3 unverified), Nova major version (must match), and Laravel version (inherited from Nova's own constraints). Also confirm whether the field requires publishing compiled assets or a frontend build step — Nova 3 and Nova 4 differ here, and getting it wrong produces a silently blank cell rather than an error.
Sequencing Low urgency. Bundle it into the next routine dependency-refresh PR rather than a dedicated change. If the team is mid-upgrade to PHP 8.1, this can ride along; if the team is staying on PHP 8.0 for now, 1.0.3 buys nothing and 1.0.2 remains fine. Do not let it gate a PHP 8.1 upgrade — it is a cosmetic field and can be dropped if it obstructs the runtime upgrade.
Maintenance Near-zero. No scheduled jobs, no config, no migrations, no published service provider. The only recurring cost is tracking the package against Nova upgrades — which is precisely when it is most likely to break, since Nova majors routinely restructure the custom-field contract.
Support Community-supported, single-repo, small contributor base. Do not expect SLAs or prompt responses. Mitigation: the package is small enough to fork or inline into the application as a local field if upstream stalls. Budget a half-day to vendor it if that becomes necessary.
Scaling Effectively free at the application tier — it is string formatting. The one scaling caveat is I/O: if the field resolves file size from disk per row, an index view of 50 records against S3 becomes 50 sequential network round-trips, which degrades page load linearly with page size. Confirm the data source before enabling it on high-traffic admin tables; prefer formatting a stored integer column over live filesystem lookups.
Failure modes
composer constraint conflict blocking an unrelated dependency resolution.Ramp-up Minutes. Any Laravel developer who has written a Nova field can read the whole package in one sitting. No specialist knowledge, no runbook, no on-call implications. Document the field declaration in the resource and move on.
How can I help you explore Laravel packages today?