This package provides a simple and intuitive way to work on the Youtube Data API. It provides fluent interface to Youtube features.

Overview

Laravel Youtube Client

This package provides a simple and intuitive way to work on the Youtube Data API. It provides fluent interface to Youtube features.

Objectives to be achieved with this package:

  • YouTube Data API v3
    • List video from my channel
    • List my channel playlist
    • Show channel subscription button

Installation

  composer require tilson/laravel-youtube-client

After installing, define in the .env file the environment variables API_YOUTUBE_KEY and CHANNEL_ID, which corresponds to the api key and the ID of your youtube channel

Publish the package:

php artisan vendor:publish --provider="Tilson\YoutubeApi\Providers\YoutubeApiServiceProvider"

In your app.php register our service provider.

    // config/app.php
    'providers' => ServiceProvider::defaultProviders()->merge([
        // ...
       Tilson\YoutubeApi\Providers\YoutubeApiServiceProvider::class,
       
       // ...
    ])->toArray(),

Use the client class

use \Tilson\YoutubeApi\Client;

$client = app(Client::class);
//or Injecting Dependency
public function __construct(private Client $client)
{
// you code
}

List video from my channel

use \Tilson\YoutubeApi\Client;
use \Tilson\YoutubeApi\Enums\OrderBy;

$client->lisChannelVideos()
->order(OrderBy::DATE)
->limit(10);
->get();

List playlist from my channel

use \Tilson\YoutubeApi\Client;

$client->listPlaylists()->limit(10)->get();

Show subscription button

<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        @youtubeScriptButton() <--- Add This
        <title>Laravel</title>
    </head>
    <body class="antialiased">
       @youtubeButton()   <--- Add This (Show the Button)
    </body>
</html>

In the youtube_api.php file you can change some settings for the button.

Contributing

Thank you for considering contributing to the Laravel framework! Please feel free to contribute your PR and report issues.

License

This package is open-sourced software licensed under the MIT.

You might also like...
An easy-to-use web interface for downloading bittorrents, videos from twitter, youtube and the likes
An easy-to-use web interface for downloading bittorrents, videos from twitter, youtube and the likes

An easy-to-use web interface for Aria2 and youtube-dl Search for torrents within the app from mutiple BT sites Control Aria2 and manage download tasks

This Kirby V3 Plugin brings snippets and blueprints together in one place. It includes useful tools that completely changing the way you work with Kirby: Fast and well organized.
This Kirby V3 Plugin brings snippets and blueprints together in one place. It includes useful tools that completely changing the way you work with Kirby: Fast and well organized.

Kirby Components Overview Do you love to make awesome projects with Kirby CMS? Do you also find it difficult to switch between snippets and blueprints

Creating data transfer objects with the power of php objects. No php attributes, no reflection api, and no other under the hook work.

Super Simple DTO Creating data transfer objects with the power of php objects. No php attributes, no reflection api, and no other under the hook work.

The swiss army knife for Magento developers, sysadmins and devops. The tool provides a huge set of well tested command line commands which save hours of work time. All commands are extendable by a module API.

netz98 magerun CLI tools for Magento 2 The n98 magerun cli tools provides some handy tools to work with Magento from command line. Build Status Latest

provides a nested object property based user interface for accessing this configuration data within application code

laminas-config This package is considered feature-complete, and is now in security-only maintenance mode, following a decision by the Technical Steeri

Create executable strings using a fluent API.

command-builder A PHP class to build executable with using fluent API. Summary About Features Installation Examples Compatibility table Tests About I

MOP is a php query handling and manipulation library providing easy and reliable way to manipulate query and get result in a fastest way
MOP is a php query handling and manipulation library providing easy and reliable way to manipulate query and get result in a fastest way

Mysql Optimizer mysql optimizer also known as MOP is a php query handling and manipulation library providing easy and reliable way to manipulate query

Melek Berita Backend is a service for crawling data from various websites and processing the data to be used for news data needs.

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Code to accompany the YouTube video "Full PHP cURL API tutorial - how to use a REST API from PHP using cURL"

PHP cURL CRUD Example Example code to accompany this YouTube video. Note that the init_curl.php file contains a placeholder for an API key. DO NOT che

Releases(1.0.0)
  • 1.0.0(May 26, 2023)

    V.1.0.0

    This version of the package has 3 basic features:

    • YouTube Data API v3
      • [x] List video from my channel
      • [x] List my channel playlist
      • [x] Show channel subscription button
    Source code(tar.gz)
    Source code(zip)
Owner
Tilson Mateus
Coding the future with PHP: Turning ideas into reality.
Tilson Mateus
Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

Introduction Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services. It handles almost all of the boilerpl

The Laravel Framework 2.2k Dec 31, 2022
A simple, standalone, modern PHP class inspector and mapper library, wrapping PHPs native reflection in a fluent interface

A simple, standalone, modern PHP class inspector and mapper library, wrapping PHPs native reflection in a fluent interface.

smpl 9 Sep 1, 2022
Strings Package provide a fluent, object-oriented interface for working with multibyte string

Strings Package provide a fluent, object-oriented interface for working with multibyte string, allowing you to chain multiple string operations together using a more readable syntax compared to traditional PHP strings functions.

Glowy PHP 14 Mar 12, 2022
A fluent interface for interacting with Netopia's services.

laravel-netopia A fluent interface for interacting with Netopia's services. Info Database It'll create a table named netopia_payments with the followi

Codestage 3 Oct 10, 2022
CPAY is a sdk that encapsulates the Orange Money api with an intuitive syntax allowing you to integrate the Orange Money payment into your PHP project.

CPAY CHOCO PAY is a sdk that encapsulates the Orange Money api with an intuitive syntax allowing you to integrate the Orange Money payment into your P

faso-dev 1 Oct 26, 2022
A PHP Library To Make Your Work Work Easier/Faster

This Is A Php Library To Make Your Work Easier/Faster,

functionality 2 Dec 30, 2022
Laravel Plans is a package for SaaS apps that need management over plans, features, subscriptions, events for plans or limited, countable features.

Laravel Plans Laravel Plans is a package for SaaS apps that need management over plans, features, subscriptions, events for plans or limited, countabl

ángel 2 Oct 2, 2022
A PHP Package to work with OS processes in an OOP way.

OS Process This package is a wrapper around the Symfony Process component, and build up an API that is object-oriented and user-friendly. Installation

Steve McDougall 58 Jan 1, 2023
Arc youtube - Youtube plugin for Textpattern

arc_youtube A Textpattern plugin for easily embedding Youtube videos in pages using a customisable player. This plugin works well with arc_vimeo and o

Andy Carter 5 May 17, 2018
Michael Pratt 307 Dec 23, 2022