Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Nova File Size Field

Nova File Size Field Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Laravel Nova File Size field.

Frequently asked questions about Nova File Size Field
How do I install itiden/nova-file-size-field in a Laravel Nova project?
Install it with Composer using composer require itiden/nova-file-size-field, then swap the field declaration in your Nova resource. There is no service provider to register, no config file to publish and no migration to run. Pin ^1.0.3 in composer.json and verify the resolution against your PHP and Nova constraints on a scratch branch first.
Which Laravel Nova version does nova-file-size-field support?
Nova custom fields are tightly bound to the Nova major version, so you must confirm the target major explicitly before adopting it. The 1.0.x line most plausibly targets Nova 3.x, and Nova 4 projects may need a different field entirely. Check the repository's composer.json constraints before planning around it.
Does this field work with PHP 8.1, 8.2 and 8.3?
Release 1.0.3 was contributed specifically to add PHP 8.1 compatibility, so 8.1 is the confirmed floor. There is no evidence of testing on PHP 8.2 or 8.3, so treat the upper bound as unverified. If you run newer runtimes, smoke-test the field in a branch before adopting it.
How do I use the file size field in a Nova resource?
Add the package's field class to the fields() method of your Nova resource, in place of the Number or Text field that currently shows raw bytes. The field is display-only: it formats an existing integer value, so the underlying column stays unchanged. It is a one-line change per affected resource.
Does the package format a stored integer column or stat a file on disk?
The package is described as a presentation-layer field that converts a raw byte value into KB, MB or GB, which points to formatting an existing integer column rather than statting a file. That is also the safer design for index views, since it avoids a filesystem call per row. Verify against the source if your column holds a path instead of a size.
Will this field work with S3 or remote filesystem disks?
Nothing in the package overview mentions filesystem access, remote disks or S3, and the described behaviour is formatting a stored byte value. If the field only formats an integer, the disk driver is irrelevant. If you need sizes calculated from files on S3, confirm the behaviour in the source before relying on it.
Do I need to run migrations or publish assets after installing?
No schema change, data migration, queue or config surface is involved, so there is nothing to migrate. Whether compiled frontend assets need publishing depends on the Nova major version, since Nova 3 and Nova 4 differ in their asset pipeline. Getting that wrong typically produces a silently blank cell rather than an error.
How do I test the file size field in my Nova application?
Treat it as a display-only field and assert that the rendered value matches the expected human-readable string for a known byte count. Because the blast radius is a misrendered cell rather than a broken write path, a simple resource or browser test is usually sufficient. There is no documented CI matrix for the supported PHP and Nova combinations, so your own test coverage matters.
Is nova-file-size-field safe to use in production, and how do I uninstall it?
Risk is low: no models, migrations or lifecycle hooks are touched, and the worst case is a misrendered cell rather than data loss. To remove it, revert the field declaration in each resource and run composer remove. There is no state to unwind.
Are there alternatives to nova-file-size-field for displaying file sizes in Nova?
If you already format sizes in a model accessor or a custom Vue component, this package is redundant. A plain Nova Text or Number field backed by a formatted accessor covers the same need with no extra dependency. Given the small maintenance footprint and Nova version coupling, vendoring the field or inlining a formatter are reasonable options.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle
adachsoft/api-version-bundle
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager