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
<?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);
}
}
$ phpunit
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.
This project exists thanks to all the people who contribute.
Mozilla Public License Version 2.0 (MPL-2.0).