Completed
Push — master ( ac13d3...9f68b4 )
by
unknown
01:57
created

ServiceProvider::migrations()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php namespace Taskforcedev\LaravelForum;
2
3
use Illuminate\Support\ServiceProvider as IlluminateServiceProvider;
4
5
/**
6
 * Class ServiceProvider
7
 *
8
 * @package Taskforcedev\LaravelForum
9
 */
10
class ServiceProvider extends IlluminateServiceProvider
11
{
12
    public function register()
13
    {
14
    }
15
16
    /**
17
     * Loads config, views and routes from the package and parent app.
18
     */
19
    public function boot()
20
    {
21
        $this->views();
22
        $this->routes();
23
        $this->migrations();
24
        $this->config();
25
    }
26
27
    /**
28
     * Register the config and merge any published config.
29
     */
30
    public function config()
31
    {
32
        // Publish Config
33
        $this->publishes([
34
            __DIR__ . '/../config/laravel-forum.php' => config_path('laravel-forum.php'),
35
        ], 'config');
36
37
        $this->mergeConfigFrom(
38
            __DIR__ . '/../config/laravel-forum.php',
39
            'laravel-forum'
40
        );
41
42
        // Merge default Config
43
        $published = __DIR__.'/../../../../config/laravel-forum.php';
44
        if (file_exists($published)) {
45
            $this->mergeConfigFrom(
46
                $published,
47
                'laravel-forum'
48
            );
49
        }
50
    }
51
52
    /**
53
     * Loads the views into the laravel-forum view namespace.
54
     */
55
    public function views()
56
    {
57
        $this->loadViewsFrom(__DIR__ . '/../resources/views', 'laravel-forum');
58
    }
59
60
    /**
61
     * Loads the routes.
62
     */
63
    public function routes()
64
    {
65
        require __DIR__ . '/Http/routes.php';
66
    }
67
68
    /**
69
     * Register the package migrations.
70
     */
71
    public function migrations()
72
    {
73
        $this->loadMigrationsFrom(__DIR__ . '/../database/migrations');
74
    }
75
}
76