Completed
Push — master ( 9b3fc3...96b827 )
by ARCANEDEV
06:21
created

MetasRoutes::map()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 10
CRAP Score 1.0007

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 16
ccs 10
cts 11
cp 0.9091
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 9
nc 1
nop 0
crap 1.0007
1
<?php namespace Arcanesoft\Seo\Http\Routes\Admin;
2
3
use Arcanedev\Support\Routing\RouteRegistrar;
4
use Arcanesoft\Seo\Models\Meta;
5
6
/**
7
 * Class     MetasRoutes
8
 *
9
 * @package  Arcanesoft\Seo\Http\Routes\Admin
10
 * @author   ARCANEDEV <[email protected]>
11
 */
12
class MetasRoutes extends RouteRegistrar
13
{
14
    /* -----------------------------------------------------------------
15
     |  Main Methods
16
     | -----------------------------------------------------------------
17
     */
18
    /**
19
     * Define the routes for the application.
20
     */
21 16
    public function map()
22
    {
23
        $this->bind('seo_meta', function ($id) {
24
            return Meta::findOrFail($id);
25 16
        });
26
27
        $this->prefix('metas')->name('metas.')->group(function () {
28 16
            $this->get('/', 'MetasController@index')
29 16
                 ->name('index'); // admin::seo.metas.index
30
31 16
            $this->prefix('{seo_meta}')->group(function () {
32 16
                $this->get('/', 'MetasController@show')
33 16
                     ->name('show'); // admin::seo.metas.show
34 16
            });
35 16
        });
36 16
    }
37
}
38