kayacekovic/nova-audio

Audio Field for Laravel Nova

Installs: 2 517

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 18

Language:Vue

1 2021-03-29 12:05 UTC

README

An audio field for use in Laravel Nova.

Audio Field

For use when you are storing an audio file and want to listen to it from within Nova. It is built on the core File Field field type. See here for more info

Under the hood it uses thabsic HTML5 Audio tag. So MP3, WAV and OGG are supported :)

Installation

composer require kayacekovic/nova-audio

To use the field add it to your Nova Resources file (such as User.php)

use Davidpiesse\Audio\Audio;

public function fields(Request $request)
{
    return [
        ...
        Audio::make('Audio')->disk('public'),
        
        Audio::make('Audio', function() {
            return 'path-to-your-folder-on-s3'.$this->audio_file_name_from_model;
        })->disk('s3')
        ->playOnForms() // can you show audio field on update or create form
        ->expires(5),
        ...
    ];
}