Completed
Push — master ( 96b827...e9016c )
by ARCANEDEV
15:51
created

MetasRoutes::bindings()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1.0156

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 8
ccs 3
cts 4
cp 0.75
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
crap 1.0156
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
    /**
20
     * Register the bindings.
21 16
     */
22
    public static function bindings()
23
    {
24
        $registrar = new static;
25 16
26
        $registrar->bind('seo_meta', function ($id) {
27
            return Meta::findOrFail($id);
28 16
        });
29 16
    }
30
31 16
    /**
32 16
     * Define the routes for the application.
33 16
     */
34 16
    public function map()
35 16
    {
36 16
        $this->prefix('metas')->name('metas.')->group(function () {
37
            $this->get('/', 'MetasController@index')
38
                 ->name('index'); // admin::seo.metas.index
39
40
            $this->prefix('{seo_meta}')->group(function () {
41
                $this->get('/', 'MetasController@show')
42
                     ->name('show'); // admin::seo.metas.show
43
            });
44
        });
45
    }
46
}
47