PHPackages                             fbf/laravel-youtube - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. fbf/laravel-youtube

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

fbf/laravel-youtube
===================

A Laravel package to upload videos to a YouTube channel

v0.3.2(12y ago)954.2k30[14 issues](https://github.com/FbF/Laravel-Youtube/issues)[1 PRs](https://github.com/FbF/Laravel-Youtube/pulls)MITPHPPHP &gt;=5.3.0

Since Jan 17Pushed 8y ago8 watchersCompare

[ Source](https://github.com/FbF/Laravel-Youtube)[ Packagist](https://packagist.org/packages/fbf/laravel-youtube)[ RSS](/packages/fbf-laravel-youtube/feed)WikiDiscussions master Synced today

READMEChangelog (5)Dependencies (2)Versions (6)Used By (0)

Laravel-Youtube
===============

[](#laravel-youtube)

A Laravel package to upload videos to a YouTube channel and get a list of uploaded videos

It is intended for use in a website where users can upload a video file which is then uploaded to a single Youtube account, probably owned by the website owner, or to an individuals YouTube account. The account can be public or unlisted and this essentially allows you to use Youtube as a video transcoding, hosting, serving and playback service provider.

In addition to the upload and lsit functionality you can use in your own app, the package also includes the functionality to get and store an access token, so that users can upload their videos to your account without you having to authorise them each time. Google's access tokens are short lived, they only last 1 hour, but by default your app will get offline access which means as well as an access\_token, you also get a refresh\_token that can be used to renew the access token. The package handles storing the access\_token and refresh\_token in a database table (migration included) and will also handle automatically getting a new access\_token, using the refresh\_token, when an access\_token expires.

Also included is sample code for a form and a simple route closure callback that validates the form and uploads the video to Youtube.

All the sample routes do not get included when in production. They only work on local, staging etc. Your production code should only ever call the methods in the Usage section below.

Installation
------------

[](#installation)

Add the following to you composer.json file

```
"fbf/laravel-youtube": "dev-master"

```

Run

```
composer update

```

Add the following to the providers array in app/config/app.php

```
'Fbf\LaravelYoutube\LaravelYoutubeServiceProvider'

```

Add the following to the aliases array in app/config/app.php

```
'Youtube'         => 'Fbf\LaravelYoutube\YoutubeFacade',

```

Publish the config

```
php artisan config:publish fbf/laravel-youtube

```

Run the migration

```
php artisan migrate --package=fbf/laravel-youtube

```

Usage
-----

[](#usage)

After getting an access token (see section on Authentication below), to upload a video, simply do:

```
try {
    $youtubeVideoId = Youtube::upload($data);
} catch (Exception $e) {
    // Do something here
}
```

where `$data` is in the format of `Input::all()` when submitting a form like the one in `src/views/example.blade.php`, or as follows:

```
Youtube::upload(array(
    'title' => 'My video',
    'description' => 'This is what My video is about',
    'status' => 'unlisted', // or 'private' or 'public'
    'video' => $video, // Instance of Symfony\Component\HttpFoundation\File\UploadedFile see http://laravel.com/docs/requests#files
));
```

See the example in `Route::post('youtube-upload-example', function() {...})` in the `src/routes.php` file.

Authentication
--------------

[](#authentication)

The config file contains several settings. To get the values for these settings, you need to register your app with the [Google Developers Console](https://cloud.google.com/console).

Create a project, give it a name and an ID, but to be honest, it doesn't really matter what these are as no one else will ever see them.

In the APIs screen for your new project, ensure YouTube Data API v3 is on.

In the credentials screen, create a new client ID. Application type should be Web Application, Authorized Javascript origins aren't used, so leave as is, Authorized redirect URI should be your redirect uri. The package includes a route you can use as the redirect URI, which is "youtube-upload-example/oauth2-callback", so the value you should use here is the absolute URL, including the domain, e.g. "". A hostname including localhost doesn't work, however you can still do all this on your local development machine, you just need to alias a real domain in your VirtualHost config and add it to your hosts file.

Now copy the client ID and client secret into the `app/config/packages/fbf/laravel-youtube/config.php` file.

If you are going to allow all uploads to go into a single channel, before the next step, ensure that the Google Account you sign in with already has a YouTube Channel. If you have created a new Google Account just for your project, you don't get a YouTube channel automatically, this is an extra step. When you are on [www.youtube.com](http://www.youtube.com) and you go to try and upload a video manually, it will prompt you to create a channel. This gives you another Google account confusingly. Finally, visit "" in your browser, you should be redirected to "". Click "Connect Me" and then approve the app. You should then be redirected back to " which should display your access token and say that it has been added to the database. Now you should be able to upload a video, try the example.

If you are going to allow different users to upload to their own channels set the `laravel-youtube::auth` config setting to `true` and then create some actions and views in your app that use the functionality from the sample routes and example view provided, to allow your users to authenticate for you.

Todo
----

[](#todo)

Include nice wrappers for other functionality in the YouTube Service within the Google API PHP Client library

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 68.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

5

Last Release

4491d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c1890fa7f83fd77b7c73d984199cb9a45ba9871acb4133490f43115c19fe845f?d=identicon)[neilcrookes](/maintainers/neilcrookes)

---

Top Contributors

[![Jaspur](https://avatars.githubusercontent.com/u/4254854?v=4)](https://github.com/Jaspur "Jaspur (13 commits)")[![neilcrookes](https://avatars.githubusercontent.com/u/24232?v=4)](https://github.com/neilcrookes "neilcrookes (4 commits)")[![svolpe43](https://avatars.githubusercontent.com/u/2718969?v=4)](https://github.com/svolpe43 "svolpe43 (2 commits)")

### Embed Badge

![Health badge](/badges/fbf-laravel-youtube/health.svg)

```
[![Health](https://phpackages.com/badges/fbf-laravel-youtube/health.svg)](https://phpackages.com/packages/fbf-laravel-youtube)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[illuminate/pipeline

The Illuminate Pipeline package.

9446.6M213](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M862](/packages/illuminate-pagination)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)[mrmarchone/laravel-auto-crud

Laravel Auto CRUD helps you streamline development and save time.

28711.8k2](/packages/mrmarchone-laravel-auto-crud)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
