PHP code example of syrian-open-source / laravel-youtube-iframe-generator

1. Go to this page and download the library: Download syrian-open-source/laravel-youtube-iframe-generator 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/ */

    

syrian-open-source / laravel-youtube-iframe-generator example snippets


{!! \SOS\LaravelYoutubeFrameGenerator\Facades\YFrameFacade::generate('https://www.youtube.com/watch?v=35JzR2ymxJE')!!}


@yframe('https://www.youtube.com/watch?v=35JzR2ymxJE')


{!! \SOS\LaravelYoutubeFrameGenerator\Facades\YFrameFacade::width('100%')
        ->height('400px')
        ->isFullscreen(true)
        ->generate('https://www.youtube.com/watch?v=35JzR2ymxJE'); !!}


@yframe('https://www.youtube.com/watch?v=35JzR2ymxJE', [
    'width'     => '100%',
    'height'    => '400px',
    'isFullscreen'  => true,
])

shell
php artisan yframe:install