Completed
Push — master ( 800114...d023f1 )
by ARCANEDEV
04:49
created

MetasRoutes::bindings()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1.008

Importance

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