Completed
Push — master ( 69a7ec...8180d7 )
by Manel
02:21
created

EnrollmentMobileServiceProvider::publishConfig()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 9
c 0
b 0
f 0
ccs 0
cts 9
cp 0
rs 9.6666
cc 1
eloc 6
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Scool\EnrollmentMobile\Providers;
4
5
6
use Illuminate\Support\ServiceProvider;
7
8
    /**
9
     * Class EnrollmentServiceProvider
10
     * @package Scool\Enrollment\Providers
11
     */
12
    class EnrollmentMobileServiceProvider extends ServiceProvider
13
    {
14
        public function register()
15
        {
16
            if (!defined('SCOOL_ENROLLMENT_MOBILE_PATH')) {
17
                define('SCOOL_ENROLLMENT_MOBILE_PATH', realpath(__DIR__.'/../../'));
18
            }
19
        }
20
21
        public function boot()
22
        {
23
            $this->loadMigrations();
24
            $this->publishFactories();
25
            $this->publishConfig();
26
            $this->publishTests();
27
        }
28
29
        public function loadMigrations()
30
        {
31
            $this->loadMigrationsFrom(SCOOL_ENROLLMENT_MOBILE_PATH.'/database/migrations');
32
        }
33
34
        public function publishFactories()
35
        {
36
            $this->publishes(
37
          [ SCOOL_ENROLLMENT_MOBILE_PATH . '/database/Enrollment.php' =>
38
            database_path().'/factories/EnrollmentMobileFactory.php'],
39
            "scool_enrollment_mobile"
40
        );
41
        }
42
43
        public function publishTests()
44
        {
45
            $this->publishes(
46
        [
47
            SCOOL_ENROLLMENT_MOBILE_PATH .
48
            '/tests/EnrollmentMobileTest.php' => 'tests/EnrollmentMobileTest.php'
49
        ], "scool_enrollment_mobile"
50
        );
51
        }
52
        private function publishConfig() {
53
            $this->publishes(
54
                [ SCOOL_ENROLLMENT_MOBILE_PATH . '/config/enrollment.php' =>
55
                    database_path().'/factories/EnrollmentMobileFactory.php'],"scool_enrollment_mobile"
56
            );
57
            $this->mergeConfigFrom(
58
                SCOOL_ENROLLMENT_MOBILE_PATH . '/config/enrollment_mobile.php', 'scool_enrollment_mobile'
59
            );
60
        }
61
    }
62