githubEdit

Usage with Larupload

circle-info

Larapload is a user-friendly package for managing media and uploads. To fully leverage the capabilities offered by NovaVideo, we recommend reading the Larapload documentationarrow-up-right first. This will ensure that you can take full advantage of the available abilities and seamlessly integrate media management and uploads into your Laravel Nova application.

Follow these steps to set up Larupload and integrate it with your project:

  1. Install Larupload using thisarrow-up-right documentation

  2. Add Larupload Columns to Your Table:

In your migration file, add Larupload columns to your table. Here's an example:

<?php

use Mostafaznv\Larupload\Enums\LaruploadMode;


class CreateMediaTable extends Migration
{
    public function up()
    {
        Schema::create('media', function (Blueprint $table) {
            $table->id();
            $table->upload('video', LaruploadMode::LIGHT);
            $table->timestamps();
        });
    }
}
  1. Add Larupload Trait to Your Model:

Next, add the Larupload trait to your model. Define upload entities as needed. Here's an example:

  1. Add NovaVideo Field to Your Resource:

In your Nova resource, add the NovaVideo field for the video column. Configure it as needed. Here's an example:

circle-info

Larupload has its own disk, so the third argument of the make function (disk) is not used when you are using Larupload to handle the upload process.

Last updated