- How do I install and configure davidpiesse/nova-audio in a Laravel Nova resource?
- Install it with composer require davidpiesse/nova-audio, add a string column to your model migration, and register Audio::make('Track', 'track')->disk('public')->path('audio/tracks') in the Nova resource. Run php artisan storage:link so the public disk is reachable by the browser. Because the field writes a plain filename into a normal Eloquent attribute, no extra storage layer or schema coupling is involved. Pin the commit or vendor the source, since the package has no upstream support.
- Does davidpiesse/nova-audio work with Laravel Nova 4 or Nova 5?
- The last release was April 2020, which places the field in the Nova 2/3 era with a Vue 2 frontend component. Nova 4 (2021) and Nova 5 (2024) reworked the field and frontend layers, so on those versions plan a port or rebuild rather than a drop-in integration. With no dependents and no recent compatibility claims, verify it with a timeboxed spike that boots Nova with the field registered instead of trusting the README. Treat Nova 1 to 3 on roughly PHP 7.2 to 7.4 as the only realistic fit.
- How do I set the storage disk and directory for the Nova audio field?
- Configure them fluently in the field definition using ->disk('public') and ->path('audio/tracks'), for example. The resulting relative path is written to the model string attribute, so you can resolve URLs later with Storage::disk($disk)->url($model->track). Keep the path consistent across environments and make sure the disk is writable by the web server. If you use a private disk, verify how the field builds its player URL before relying on it.
- Does nova-audio support private audio files or signed URLs?
- This is not documented and must be verified in the source before planning any non-public audio use case. The classic failure mode is that the field builds a plain Storage::url() rather than a temporary or signed URL, so any file on a private disk returns a 403 in the native audio player. If your audio is regulated or shown to clients, budget for adding signed-URL handling yourself. Public disks are the safer default with this package.
- What Laravel and PHP versions does davidpiesse/nova-audio support?
- It is only viable on Laravel Nova 1 to 3 with roughly PHP 7.2 to 7.4, matching its April 2020 release. It is a Nova field rather than a general Laravel audio library, so it is meaningless outside Nova and should not be evaluated as one. On Nova 4 or 5, or Laravel 9 and above, the correct framing is a rewrite rather than an integration. Check the composer constraints in the repository for the exact requirements before committing.
- Is davidpiesse/nova-audio still maintained, and what are the alternatives?
- No. It has one maintainer, around 22 stars, no release since April 2020, and no security-response surface, so adopting it is effectively adopting an unowned fork whether you call it that or not. The pragmatic option is to vendor the source into nova-components/ or an internal namespace, pin the commit, and own the tests. If you are on Nova 4 or 5, rebuilding the field as an in-house component is usually cheaper than fighting an unsupported Vue 2 integration. Other maintained Nova media fields exist, but evaluate them on the same version-compatibility and ownership criteria.
- How do I validate audio file size and MIME type with nova-audio?
- The package will not reliably enforce MIME type or size on its own, so validation is your responsibility. Add extension and MIME allowlisting through ->rules() on the field and mirror the same rules in your form request or model layer. Also tune upload_max_filesize, post_max_size, and Nginx client_max_body_size to match your intended limits, since PHP and the web server reject oversized uploads before Nova sees them. Treat this as mandatory hardening, not optional polish.
- Can I access the uploaded audio outside Nova, such as in a Blade view or an API?
- Yes. The field stores the audio path in a normal string column, so any part of the application can read it, including Blade views, queue jobs, exports, and future APIs. Use Storage::disk($disk)->url($model->track), or a temporary URL for private disks, and keep the disk name in configuration rather than hardcoding it. Because there is no proprietary storage layer, the asset is never locked into Nova. This is the package's biggest architectural strength.
- Does nova-audio support multiple audio files, waveforms, or duration extraction?
- No. The field is deliberately thin: it handles upload, storage, and a native audio-player preview, and nothing else. There is no transcoding, duration extraction, waveform rendering, orphan cleanup, or accessibility layer beyond what the browser audio element provides. If multi-file uploads, waveforms, or duration are already on your product backlog, plan to build those features yourself or choose a different abstraction. Three single-purpose fields may be the wrong design if audio preview becomes the wedge for a broader media strategy.
- How do I test the Nova audio field and catch breakage after a Nova upgrade?
- A Nova upgrade can break the field JavaScript silently, so admins see a blank input and uploads stop without anyone noticing for a week. Mitigate with a CI job that boots Nova with the field registered and asserts the component mounts, so a break fails loudly. Add feature tests that post a small audio file through the resource and assert the path is written to the model column. If you vendor the source, own these tests yourself, since the package ships no support safety net.