123movies-seo/app/Providers/TmdbServiceProvider.php

47 lines
939 B
PHP
Raw Permalink Normal View History

2024-08-24 23:08:42 +03:00
<?php
namespace App\Providers;
use App\Services\TmdbClient;
use Illuminate\Contracts\Support\DeferrableProvider;
use Illuminate\Support\ServiceProvider;
class TmdbServiceProvider extends ServiceProvider
{
/**
* Register services.
*
* @return void
*/
public function register()
{
$this->app->singleton(TmdbClient::class, function ($app) {
return new TmdbClient(
$app['config']['services']['tmdb']['key'],
$app['config']['services']['tmdb']['use_cache'],
$app['config']['services']['tmdb']['cache_ttl'],
);
});
}
/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
return [TmdbClient::class];
}
/**
* Bootstrap services.
*
* @return void
*/
public function boot()
{
//
}
}