Completed
Pull Request — master (#10)
by
unknown
01:47
created

MicroboardServiceProvider::boot()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 24

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 0
dl 0
loc 24
rs 9.536
c 0
b 0
f 0
1
<?php
2
3
namespace Microboard\Providers;
4
5
use Illuminate\Support\ServiceProvider;
6
use Microboard\Commands\InstallCommand;
7
use Microboard\Commands\ResourceCommand;
8
use Microboard\Commands\ResourceController;
9
use Microboard\Commands\ResourceDataTables;
10
use Microboard\Commands\ResourceRequest;
11
use Microboard\Commands\ResourcePolicy;
12
use Microboard\Commands\WidgetMakeCommand;
13
use Microboard\Factory;
14
15
class MicroboardServiceProvider extends ServiceProvider
16
{
17
    /**
18
     * Bootstrap the package services.
19
     */
20
    public function boot()
21
    {
22
        $this->loadMigrationsFrom(__DIR__ . '/../../database');
23
24
        if ($this->app->runningInConsole()) {
25
            $this->publishes([
26
                __DIR__ . '/../../config/config.php' => config_path('microboard.php'),
27
                __DIR__ . '/../../stubs/web.stub' => base_path('routes/microboard.php'),
28
                __DIR__ . '/../../stubs/service.stub' => app_path('Providers/MicroboardServiceProvider.php'),
29
                __DIR__ . '/../../stubs/datatable-script.stub' => resource_path('views/vendor/datatables/script.blade.php'),
30
                __DIR__ . '/../../stubs/user-placeholder.png' => public_path('storage/user-placeholder.png'),
31
            ], 'microboard');
32
33
            $this->commands([
34
                InstallCommand::class,
35
                WidgetMakeCommand::class,
36
                ResourceDataTables::class,
37
                ResourceController::class,
38
                ResourcePolicy::class,
39
                ResourceRequest::class,
40
                ResourceCommand::class
41
            ]);
42
        }
43
    }
44
45
    /**
46
     * Register the package services.
47
     */
48
    public function register()
49
    {
50
        $this->mergeConfigFrom(__DIR__ . '/../../config/config.php', 'microboard');
51
        $this->app->singleton(Factory::class);
52
    }
53
}
54