CountersServiceProvider::boot()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 13
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 13
rs 10
cc 2
nc 2
nop 0
1
<?php
2
namespace Turahe\Counters;
3
4
use Turahe\Counters\Facades\Counters;
5
use Illuminate\Foundation\AliasLoader;
6
use Illuminate\Support\ServiceProvider;
7
8
class CountersServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Bootstrap the application services.
12
     *
13
     * @return void
14
     */
15
    public function boot()
16
    {
17
        $this->app->booted(function () {
18
            $loader = AliasLoader::getInstance();
19
            $loader->alias('Counters', Counters::class);
20
        });
21
22
        $this->publishes([
23
            __DIR__.'/../database/migrations/0000_00_00_000000_create_counters_tables.php' => $this->app->databasePath().'/migrations/0000_00_00_000000_create_counters_tables.php',
24
        ], 'migrations');
25
26
        if ($this->app->runningInConsole()) {
27
            $this->commands([\Turahe\Counters\Commands\MakeCounter::class]);
28
        }
29
    }
30
}
31