Completed
Push — master ( 47438c...afb949 )
by ARCANEDEV
09:00
created

RouteServiceProvider::getAdminMediaPrefix()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
crap 1
1
<?php namespace Arcanesoft\Media\Providers;
2
3
use Arcanesoft\Core\Bases\RouteServiceProvider as ServiceProvider;
4
use Arcanesoft\Media\Http\Routes;
5
use Illuminate\Contracts\Routing\Registrar as Router;
6
7
/**
8
 * Class     RouteServiceProvider
9
 *
10
 * @package  Arcanesoft\Media\Providers
11
 * @author   ARCANEDEV <[email protected]>
12
 */
13
class RouteServiceProvider extends ServiceProvider
14
{
15
    /* ------------------------------------------------------------------------------------------------
16
     |  Main Functions
17
     | ------------------------------------------------------------------------------------------------
18
     */
19
    /**
20
     * Define the routes for the application.
21
     *
22
     * @param  \Illuminate\Contracts\Routing\Registrar  $router
23
     */
24 8
    public function map(Router $router)
25
    {
26 8
        $this->mapAdminRoutes($router);
27 8
    }
28
29
    /* ------------------------------------------------------------------------------------------------
30
     |  Routes
31
     | ------------------------------------------------------------------------------------------------
32
     */
33
    /**
34
     * Register the admin routes.
35
     *
36
     * @param  \Illuminate\Contracts\Routing\Registrar  $router
37
     */
38 8
    private function mapAdminRoutes(Router $router)
39
    {
40 8
        $attributes = $this->getAdminAttributes(
41 8
            'media.',
42 8
            'Arcanesoft\\Media\\Http\\Controllers\\Admin',
43 8
            $this->config()->get('arcanesoft.media.route.prefix', 'media')
44 4
        );
45
46 8
        $router->group($attributes, function (Router $router) {
47 8
            Routes\Admin\MediaRoutes::register($router);
48 8
        });
49 8
    }
50
}
51