Basic Usage
Add a String Column to Your Table
Add a string column to your table. Here's an example of how to do it in a migration file:
class CreateMediaTable extends Migration
{
    public function up()
    {
        Schema::create('media', function (Blueprint $table) {
            $table->id();
            $table->string('video')->nullable();
            $table->timestamps();
        });
    }
}Add a Disk to config/filesystems.php
In your config/filesystems.php file, add a disk configuration for media as follows:
'disks' => [
    'media' => [
        'driver'  => 'local',
        'root'    => public_path('uploads/media'),
        'url'     => env('APP_URL') . 'uploads/media'
    ]
],Add NovaVideo Field to Your Resource
Here's an example of how to do it:
<?php
namespace App\Nova;
use Illuminate\Http\Request;
use Laravel\Nova\Fields\ID;
use Mostafaznv\NovaVideo\Video;
use App\Models\Media as MediaModel;
class Media extends Resource
{
    public static string $model = MediaModel::class;
    public function fields(Request $request): array
    {
        return [
            ID::make()->sortable(),
            Video::make(trans('Video'), 'video', 'media')
                ->rules('file', 'max:150000', 'mimes:mp4', 'mimetypes:video/mp4')
                ->creationRules('required')
                ->updateRules('nullable'),
        ];
    }
}Enjoy
Last updated