faustbrian/laravel-vidible

This package is abandoned and no longer maintained. The author suggests using the artisanry/vidible package instead.

Video attachment and management for your Eloquent models.

2.2.0 2019-08-28 13:07 UTC

README

Build Status PHP from Packagist Latest Version License

Installation

Require this package, with Composer, in the root directory of your project.

$ composer require artisanry/vidible

To get started, you'll need to publish the vendor assets and modify it:

php artisan vendor:publish --provider="Artisanry\Vidible\VidibleServiceProvider"

The package configuration will now be located at app/config/vidible.php and the migration at database/migrations/2015_01_30_000000_create_vidible_table.php.

To finish the installation you need to migrate the vidible table by executing:

php artisan migrate

Usage

<?php

namespace App\Http\Controllers;

use App\User;
use Artisanry\Vidible\VidibleService as Vidible;
use Illuminate\Http\Request;

class VidibleController extends Controller {

    public function index(Request $request, Vidible $vidible)
    {
        // Load the model the video will be attached to
        $user = User::find(1);

        // The video that should be uploaded
        $file = $request->files->all()['video'];

        // Upload the video and create a database record
        $video = $vidible->withFile($file)
                         ->withModel($user)
                         ->withAttributes(['slot' => 'trailer'])
                         ->withFilters(['watermark'])
                         ->commit(true);

        // Get the shareable url of the created video
        $video = $vidible->withFilters(['watermark'])
                         ->getShareableLink($video);

        // Display the shareable url
        echo($video);
    }

}

Testing

$ phpunit

Security

If you discover a security vulnerability within this package, please send an e-mail to hello@basecode.sh. All security vulnerabilities will be promptly addressed.

Credits

This project exists thanks to all the people who contribute.

License

Mozilla Public License Version 2.0 (MPL-2.0).