RepositoryServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Yeelight\Providers;
4
5
use Illuminate\Support\ServiceProvider;
6
7
/**
8
 * Class RepositoryServiceProvider
9
 *
10
 * @category Yeelight
11
 *
12
 * @package Yeelight\Providers
13
 *
14
 * @author Sheldon Lee <[email protected]>
15
 *
16
 * @license https://opensource.org/licenses/MIT MIT
17
 *
18
 * @link https://www.yeelight.com
19
 */
20
class RepositoryServiceProvider extends ServiceProvider
21
{
22
    /**
23
     * Bootstrap the application services.
24
     *
25
     * @return void
26
     */
27
    public function boot()
28
    {
29
        $this->mergeConfigFrom(base_path('vendor/prettus/l5-repository/src/resources/config/repository.php'), 'repository');
30
31
        $this->loadTranslationsFrom(base_path('vendor/prettus/l5-repository/src/resources/lang'), 'repository');
32
    }
33
34
    /**
35
     * Register the application services.
36
     *
37
     * @return void
38
     */
39
    public function register()
40
    {
41
        $this->commands('Yeelight\Generators\Commands\RepositoryCommand');
42
        $this->commands('Yeelight\Generators\Commands\TransformerCommand');
43
        $this->commands('Yeelight\Generators\Commands\PresenterCommand');
44
        $this->commands('Yeelight\Generators\Commands\EntityCommand');
45
        $this->commands('Yeelight\Generators\Commands\ValidatorCommand');
46
        $this->commands('Yeelight\Generators\Commands\ControllerCommand');
47
        $this->commands('Yeelight\Generators\Commands\ApiControllerCommand');
48
        $this->commands('Yeelight\Generators\Commands\RequestCommand');
49
        $this->commands('Yeelight\Generators\Commands\BindingsCommand');
50
        $this->commands('Yeelight\Generators\Commands\CriteriaCommand');
51
        $this->commands('Yeelight\Generators\Commands\ViewsCommand');
52
        $this->commands('Yeelight\Generators\Commands\LangCommand');
53
54
        $this->app->bind(\Yeelight\Repositories\Interfaces\AdminUserRepository::class, \Yeelight\Repositories\Eloquent\AdminUserRepositoryEloquent::class);
55
        $this->app->bind(\Yeelight\Repositories\Interfaces\AdminRoleRepository::class, \Yeelight\Repositories\Eloquent\AdminRoleRepositoryEloquent::class);
56
        $this->app->bind(\Yeelight\Repositories\Interfaces\AdminPermissionRepository::class, \Yeelight\Repositories\Eloquent\AdminPermissionRepositoryEloquent::class);
57
        $this->app->bind(\Yeelight\Repositories\Interfaces\AdminMenuRepository::class, \Yeelight\Repositories\Eloquent\AdminMenuRepositoryEloquent::class);
58
        $this->app->bind(\Yeelight\Repositories\Interfaces\AdminOperationLogRepository::class, \Yeelight\Repositories\Eloquent\AdminOperationLogRepositoryEloquent::class);
59
        $this->app->bind(\Yeelight\Repositories\Interfaces\UserRepository::class, \Yeelight\Repositories\Eloquent\UserRepositoryEloquent::class);
60
        $this->app->bind(\Yeelight\Repositories\Interfaces\SocialiteUserRepository::class, \Yeelight\Repositories\Eloquent\SocialiteUserRepositoryEloquent::class);
61
        $this->app->bind(\Yeelight\Repositories\Interfaces\ProductModelRepository::class, \Yeelight\Repositories\Eloquent\ProductModelRepositoryEloquent::class);
62
        $this->app->bind(\Yeelight\Repositories\Interfaces\ProductModelRepository::class, \Yeelight\Repositories\Eloquent\ProductModelRepositoryEloquent::class);
63
        //:end-bindings:
64
    }
65
66
    /**
67
     * Get the services provided by the provider.
68
     *
69
     * @return array
70
     */
71
    public function provides()
72
    {
73
        return [];
74
    }
75
}
76