Package Data | |
---|---|
Maintainer Username: | nWidart |
Maintainer Contact: | n.widart@gmail.com (Nicolas Widart) |
Package Create Date: | 2017-02-21 |
Package Last Update: | 2018-10-01 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-12 15:03:25 |
Package Statistics | |
---|---|
Total Downloads: | 116 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 18 |
Total Watchers: | 3 |
Total Forks: | 10 |
Total Open Issues: | 0 |
| Laravel | laravel-videoable | |---|---| | <= 5.4 | ^1.0 | | 5.5 | ^2.0 | | 5.7 | ^3.0 |
Laravel Videoable is a quick and easy way to add a video to your Eloquent Models. It also features a way to generate the embed code directly.
$product = Product::create(['product_name' => 'something']);
$product->addVideo([
'source' => 'youtube',
'code' => '123',
'title' => 'my video',
'width' => 50,
'height' => 150,
]);
// Get the embeddable code
$product->video->getEmbed();
// Returns
<div>
<div class="video">
<iframe id="ytplayer" type="text/html" width="100%" height="100%"
src="https://www.youtube.com/embed/123?rel=0"
frameborder="0" allowfullscreen></iframe>
</div>
</div>
Via Composer
$ composer require nwidart/laravel-videoable
Next add the following service provider in config/app.php
.
'providers' => [
Nwidart\LaravelVideoable\LaravelVideoableServiceProvider::class,
],
Publish the package's migrations files by running :
php artisan vendor:publish --provider="Nwidart\LaravelVideoable\LaravelVideoableServiceProvider" --tag=migrations
After the migrations have been published you can create the laravel_videoables
table by running the migrations
php artisan migrate
(optional) Publish the package's configuration file by running :
php artisan vendor:publish --provider="Nwidart\LaravelVideoable\LaravelVideoableServiceProvider" --tag=config
(optional) Publish the package's view files by running :
php artisan vendor:publish --provider="Nwidart\LaravelVideoable\LaravelVideoableServiceProvider" --tag=views
You'll find installation instructions and full documentation on https://nwidart.com/laravel-videoable/.
Please see CHANGELOG for more information on what has changed recently.
$ composer test
Please see CONTRIBUTING and CONDUCT for details.
If you discover any security related issues, please email n.widart@gmail.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.