RouteServiceProvider::map()   B
last analyzed

Complexity

Conditions 2
Paths 1

Size

Total Lines 25
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 25
c 0
b 0
f 0
rs 8.8571
cc 2
eloc 16
nc 1
nop 1
1
<?php
2
3
/**
4
 * Storgman - Student Organizations Management
5
 * Copyright (C) 2014-2015, Dejan Angelov <[email protected]>
6
 *
7
 * This file is part of Storgman.
8
 *
9
 * Storgman is free software: you can redistribute it and/or modify
10
 * it under the terms of the GNU General Public License as published by
11
 * the Free Software Foundation, either version 3 of the License, or
12
 * (at your option) any later version.
13
 *
14
 * Storgman is distributed in the hope that it will be useful,
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 * GNU General Public License for more details.
18
 *
19
 * You should have received a copy of the GNU General Public License
20
 * along with Storgman.  If not, see <http://www.gnu.org/licenses/>.
21
 *
22
 * @package Storgman
23
 * @copyright Copyright (C) 2014-2015, Dejan Angelov <[email protected]>
24
 * @license https://github.com/angelov/storgman/blob/master/LICENSE
25
 * @author Dejan Angelov <[email protected]>
26
 */
27
28
namespace Angelov\Storgman\Core\Providers;
29
30
use Illuminate\Routing\Router;
31
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
32
33
class RouteServiceProvider extends ServiceProvider
34
{
35
    /**
36
     * This namespace is applied to the controller routes in your routes file.
37
     *
38
     * In addition, it is set as the URL generator's root namespace.
39
     *
40
     * @var string
41
     */
42
    protected $namespace = 'Angelov\Storgman';
43
44
    /**
45
     * Define your route model bindings, pattern filters, etc.
46
     *
47
     * @param  \Illuminate\Routing\Router  $router
48
     * @return void
49
     */
50
    public function boot(Router $router)
51
    {
52
        ServiceProvider::boot($router);
53
54
        //
55
    }
56
57
    /**
58
     * Define the routes for the application.
59
     *
60
     * @param Router $router
61
     */
62
    public function map(Router $router)
63
    {
64
        $router->group(['namespace' => $this->namespace], function (Router $router) {
65
66
            $router->pattern('id', '[0-9]+');
67
68
            $modules = [
69
                'Members',
70
                'Members/Authentication',
71
                'Membership',
72
                'Meetings',
73
                'Meetings/Attachments',
74
                'Documents',
75
                'News',
76
                'Events',
77
                'Events/Comments',
78
                'Settings'
79
            ];
80
81
            foreach ($modules as $module) {
82
                require app_path($module . '/Http/routes.php');
83
            }
84
85
        });
86
    }
87
}
88