Completed
Push — master ( a77c04...464b27 )
by Andrey
16:47
created

RbacRouteServiceProvider   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 3
dl 0
loc 48
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 4 1
A map() 0 4 1
A mapWebRoutes() 0 6 1
A getRoutesFile() 0 4 1
1
<?php
2
3
namespace Itstructure\LaRbac;
4
5
use Illuminate\Support\Facades\Route;
6
use Illuminate\Foundation\Support\Providers\RouteServiceProvider;
7
8
/**
9
 * Class RbacRouteServiceProvider
10
 *
11
 * @package Itstructure\LaRbac
12
 *
13
 * @author Andrey Girnik <[email protected]>
14
 */
15
class RbacRouteServiceProvider extends RouteServiceProvider
16
{
17
    /**
18
     * This namespace is applied to your controller routes.
19
     * In addition, it is set as the URL generator's root namespace.
20
     * @var string
21
     */
22
    protected $namespace = 'Itstructure\LaRbac\Http\Controllers';
23
24
    /**
25
     * Define your route model bindings, pattern filters, etc.
26
     * @return void
27
     */
28
    public function boot()
29
    {
30
        parent::boot();
31
    }
32
33
    /**
34
     * Define the routes for the application.
35
     * @return void
36
     */
37
    public function map()
38
    {
39
        $this->mapWebRoutes();
40
    }
41
42
    /**
43
     * Define the "web" routes for the application.
44
     * These routes all receive session state, CSRF protection, etc.
45
     * @return void
46
     */
47
    protected function mapWebRoutes()
48
    {
49
        Route::middleware('web')
50
             ->namespace($this->namespace)
51
             ->group($this->getRoutesFile());
52
    }
53
54
    /**
55
     * Get routes file.
56
     * @return mixed
57
     */
58
    private function getRoutesFile()
59
    {
60
        return __DIR__ . DIRECTORY_SEPARATOR . 'routes.php';
61
    }
62
}
63