MetasRoutes::bindings()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1.0046

Importance

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