Require this package, with Composer, in the root directory of your project.
$ composer require faustbrian/laravel-vidible
And then include the service provider within app/config/app.php
.
BrianFaust\Vidible\VidibleServiceProvider::class
To get started, you'll need to publish the vendor assets and modify it:
php artisan vendor:publish --provider="BrianFaust\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 BrianFaust\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);
}
}
Please see CHANGELOG for more information what has changed recently.
$ phpunit
Please see CONTRIBUTING for details.
If you discover a security vulnerability within this package, please send an e-mail to Brian Faust at [email protected]. All security vulnerabilities will be promptly addressed.