-
Notifications
You must be signed in to change notification settings - Fork 61
/
Copy pathTmdbServiceProviderLaravel5.php
67 lines (59 loc) · 1.34 KB
/
TmdbServiceProviderLaravel5.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
/**
* @package php-tmdb\laravel
* @author Mark Redeman <[email protected]>
* @copyright (c) 2014, Mark Redeman
*/
namespace Tmdb\Laravel;
use Illuminate\Support\ServiceProvider;
class TmdbServiceProviderLaravel5 extends ServiceProvider {
/**
* Bootstrap the application events.
*
* @return void
*/
public function boot()
{
$this->publishes([
$this->defaultConfig() => config_path('tmdb.php'),
]);
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->setupConfiguration();
$this->app->bind('Tmdb\Laravel\Adapters\EventDispatcherAdapter', 'Tmdb\Laravel\Adapters\EventDispatcherLaravel5');
}
/**
* Get the TMDB configuration from the config repository
*
* @return array
*/
public function config()
{
return $this->app['config']->get('tmdb');
}
/**
* Setup configuration
*
* @return void
*/
private function setupConfiguration()
{
$config = $this->defaultConfig();
$this->mergeConfigFrom($config, 'tmdb');
}
/**
* Returns the default configuration path
*
* @return string
*/
private function defaultConfig()
{
return __DIR__ . '/config/tmdb.php';
}
}