irabbi360 / laravel-videoable
Attach Videos to your Eloquent Models
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Type:package
Requires
- php: ^7.4|^8.0
- illuminate/support: ^8.0
Requires (Dev)
- orchestra/testbench: ^6.0
- phpunit/phpunit: ^9.0
This package is auto-updated.
Last update: 2025-03-26 03:21:49 UTC
README
Laravel | laravel-videoable |
---|---|
8.x |
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.
Use HasVideos Trait in Product Model.
use HasVideos;
$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>
Install
Via Composer
$ composer require irabbi360/laravel-videoable
Next add the following service provider in config/app.php
.
'providers' => [ Irabbi360\LaravelVideoable\LaravelVideoableServiceProvider::class, ],
Publish the package's migrations files by running :
php artisan vendor:publish --provider="Irabbi360\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="Irabbi360\LaravelVideoable\LaravelVideoableServiceProvider" --tag=config
(optional) Publish the package's view files by running :
php artisan vendor:publish --provider="Irabbi360\LaravelVideoable\LaravelVideoableServiceProvider" --tag=views
Documentation
You'll find installation instructions and full documentation on https://github.com/irabbi360/laravel-videoable/.
Change log
Please see CHANGELOG for more information on what has changed recently.
Testing
$ composer test
Contributing
Please see CONTRIBUTING and CONDUCT for details.
Security
If you discover any security related issues, please email fazle08rabbi@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.