CommentableServiceProvider::boot()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

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