VoteableServiceProvider::boot()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 0
dl 0
loc 12
rs 9.8666
c 0
b 0
f 0
1
<?php
2
3
namespace Yoeunes\Voteable;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class VoteableServiceProvider extends ServiceProvider
8
{
9
    /**
10
     * Bootstrap the application events.
11
     */
12
    public function boot()
13
    {
14
        $this->publishes([
15
            __DIR__.'/../config/voteable.php' => config_path('voteable.php'),
16
        ], 'config');
17
18
        if (! class_exists('CreateVotesTable')) {
19
            $this->publishes([
20
                __DIR__.'/../migrations/create_votes_table.php' => database_path('migrations/'.date('Y_m_d_His', time()).'_create_votes_table.php'),
21
            ], 'migrations');
22
        }
23
    }
24
25
    /**
26
     * Register the service provider.
27
     */
28
    public function register()
29
    {
30
        $this->mergeConfigFrom(__DIR__.'/../config/voteable.php', 'voteable');
31
    }
32
}
33