Passed
Push — master ( 04a0d4...2a3a84 )
by Mahmoud
12:10 queued 07:56
created

IPBlockerServiceProvider::getMigrationsPath()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Larasecure\IPBlocker;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class IPBlockerServiceProvider extends ServiceProvider
8
{
9
    /**
10
     * Register the application services.
11
     *
12
     * @return void
13
     */
14
    public function register()
15
    {
16
        //
17
    }
18
19
    /**
20
     * Bootstrap the application services.
21
     *
22
     * @return void
23
     */
24
    public function boot()
25
    {
26
        $this->publishMiddleware();
27
        $this->publishMigrations();
28
        $this->publishModels();
29
    }
30
31
32
    private function publishMiddleware()
33
    {
34
        $path = $this->getMiddlwarePath();
35
        $this->publishes([$path => app_path('/Http/Middleware/IPBlocking.php')], 'ipblocker');
36
    }
37
38
    private function publishMigrations()
39
    {
40
        $path = $this->getMigrationsPath();
41
        $this->publishes([$path => database_path('migrations')], 'ipblocker');
42
    }
43
44
    private function publishModels()
45
    {
46
        $path = $this->getModelPath();
47
        $this->publishes([$path => app_path('IPBlocker.php')], 'ipblocker');
48
    }
49
50
    private function getMiddlwarePath()
51
    {
52
        return __DIR__ . '/Middlewares/IPBlocking.php';
53
    }
54
55
    private function getMigrationsPath()
56
    {
57
        return __DIR__ . '/Migrations/';
58
    }
59
60
        private function getModelPath()
61
    {
62
        return __DIR__ . '/Models/IPBlocker.php';
63
    }
64
}