Completed
Push — master ( c8daa9...5232bf )
by ARCANEDEV
12:24
created

src/FoundationServiceProvider.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php namespace Arcanesoft\Foundation;
2
3
use Arcanesoft\Core\Bases\PackageServiceProvider;
4
5
/**
6
 * Class     FoundationServiceProvider
7
 *
8
 * @package  Arcanesoft\Foundation
9
 * @author   ARCANEDEV <[email protected]>
10
 */
11
class FoundationServiceProvider extends PackageServiceProvider
0 ignored issues
show
There is one abstract method getBasePath in this class; you could implement it, or declare this class as abstract.
Loading history...
12
{
13
    /* -----------------------------------------------------------------
14
     |  Properties
15
     | -----------------------------------------------------------------
16
     */
17
    /**
18
     * Package name.
19
     *
20
     * @var string
21
     */
22
    protected $package = 'foundation';
23
24
    /* -----------------------------------------------------------------
25
     |  Main Methods
26
     | -----------------------------------------------------------------
27
     */
28
    /**
29
     * Register the service provider.
30
     */
31 21
    public function register()
32
    {
33 21
        parent::register();
34
35 21
        $this->registerConfig();
36 21
        $this->registerSidebarItems();
37 21
        $this->registerProviders([
38 21
            Providers\PackagesServiceProvider::class,
39
            Providers\AuthorizationServiceProvider::class,
40
        ]);
41 21
        $this->registerModuleProviders();
42 21
        $this->registerConsoleServiceProvider(Providers\CommandServiceProvider::class);
43 21
        $this->registerFoundationService();
44 21
    }
45
46
    /**
47
     * Boot the service provider.
48
     */
49 21
    public function boot()
50
    {
51 21
        $this->registerProviders([
52 21
            Providers\RouteServiceProvider::class,
53
            Providers\ViewComposerServiceProvider::class,
54
        ]);
55
56
        // Publishes
57 21
        $this->publishConfig();
58 21
        $this->publishViews();
59 21
        $this->publishTranslations();
60 21
        $this->publishSidebarItems();
61 21
    }
62
63
    /**
64
     * Get the services provided by the provider.
65
     *
66
     * @return array
67
     */
68 3
    public function provides()
69
    {
70
        return [
71 3
            Contracts\Foundation::class,
72
        ];
73
    }
74
75
    /* -----------------------------------------------------------------
76
     |  Services Functions
77
     | -----------------------------------------------------------------
78
     */
79
    /**
80
     * Register Foundation service.
81
     */
82 21
    private function registerFoundationService()
83
    {
84 21
        $this->singleton(Contracts\Foundation::class, Foundation::class);
85 21
    }
86
87
    /**
88
     * Register ARCANESOFT's modules (providers).
89
     */
90 21
    private function registerModuleProviders()
91
    {
92 21
        $this->registerProviders(
93 21
            $this->config()->get('arcanesoft.foundation.modules.providers', [])
94
        );
95 21
    }
96
}
97