makeabledk/laravel-youtube

Fetch data from a users youtube channel(s)

dev-master 2017-12-09 09:46 UTC

This package is auto-updated.

Last update: 2024-12-04 22:52:50 UTC


README

Fetches YouTube channel data based on oAuth

Installation

composer require makeabledk/laravel-youtube

Add the following config to your config/services.php

return [

    // ...

    'google' => [
        'oauth_client_id' => env('GOOGLE_OAUTH_CLIENT_ID'), // provide your client id
        'oauth_client_secret' => env('GOOGLE_OAUTH_CLIENT_SECRET'), // provide your client secreT
    ],

Example usage

    $user = YoutubeUser::find($token); // Provide refresh token
    $channels = $user->getChannels();

    echo $channels->first()->getSubscribers();