PHP code example of ayman-elmalah / laravel-youtube-uploader

1. Go to this page and download the library: Download ayman-elmalah/laravel-youtube-uploader 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/ */

    

ayman-elmalah / laravel-youtube-uploader example snippets


   public function another_callback(Request $request) {
          $redirect_url ='http://localhost/youtube-uploader/public/youtube/callback/another_callback';
          $video_id = 'YOUR_VIDEO_ID';
          $youtube = Youtube::setRedirectUrl($redirect_url)->updateTags($video_id, ['tag 1', 'tag2', 'Tag3', 'Tag 4']);
   }
   

    public function another_callback(Request $request) {
          $redirect_url ='http://localhost/youtube-uploader/public/youtube/callback/another_callback';
          $youtube = Youtube::setRedirectUrl($redirect_url)
                            ->createPlaylist('TITLE', 'DESCRIPTION');
    
          // Get playlist id
          $playlist_id = $youtube->createdPlaylistId();
    }
   

    public function another_callback(Request $request) {
        $redirect_url ='http://localhost/youtube-uploader/public/youtube/callback/another_callback';
        $youtube = Youtube::setRedirectUrl($redirect_url)
                          ->VideoToPlaylist('VIDEO_ID', 'PLAYLIST_ID');    
    }
   

   public function another_callback(Request $request) {
       $redirect_url ='http://localhost/youtube-uploader/public/youtube/callback/another_callback';
       $video_id = 'VIDEO_ID';
       $youtube = Youtube::setRedirectUrl($redirect_url)->deleteVideo($video_id);
   }