public function register()
{
if ($this->isLegacyLaravel() || $this->isOldLaravel()) {
$this->app['youtube'] = $this->app->share(function ($app) {
$key = \Config::get('alaouy/youtube::KEY');
return new Youtube($key);
});
return;
}
$this->publishes(array(__DIR__ . '/../../config/youtube.php' => config_path('youtube.php')));
//Laravel 5.1+ fix
if (floatval(Application::VERSION) >= 5.1) {
$this->app->bind("youtube", function () {
return $this->app->make('Alaouy\\Youtube\\Youtube', [config('youtube.KEY')]);
});
} else {
$this->app->bindShared('youtube', function () {
return $this->app->make('Alaouy\\Youtube\\Youtube', [config('youtube.KEY')]);
});
}
}