PHP code example of leadthread / laravel-viddler-upload

1. Go to this page and download the library: Download leadthread/laravel-viddler-upload library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

leadthread / laravel-viddler-upload example snippets


LeadThread\Viddler\Upload\Providers\Viddler::class

"Viddler" => LeadThread\Viddler\Upload\Facades\Viddler::class,

function upload(Request $request)
{
	$file = $request->file('file');
	$name = "My Video Title";

	/*
	 * Returns an Eloquent Model
	 */
	$model = Viddler::create($file, $name);

	// Convert the file
	$model->convert();

	// Upload it
	$model->upload();

	// Check the encoding status
	$model->check();

	return $model;
}
bash
php artisan vendor:publish --provider="LeadThread\Viddler\Upload\Providers\Viddler"
bash
php artisan migrate