Completed
Push — master ( 2ccb51...4b9a6b )
by ARCANEDEV
02:56
created

CategoriesRoutes   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 72
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 97.92%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 1
c 2
b 0
f 0
lcom 1
cbo 1
dl 0
loc 72
ccs 47
cts 48
cp 0.9792
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A map() 0 60 1
1
<?php namespace Arcanesoft\Blog\Http\Routes\Foundation;
2
3
use Arcanedev\Support\Bases\RouteRegister;
4
use Arcanesoft\Blog\Models\Category;
5
use Illuminate\Contracts\Routing\Registrar;
6
7
/**
8
 * Class     CategoriesRoutes
9
 *
10
 * @package  Arcanesoft\Blog\Http\Routes\Foundation
11
 * @author   ARCANEDEV <[email protected]>
12
 */
13
class CategoriesRoutes extends RouteRegister
14
{
15
    /* ------------------------------------------------------------------------------------------------
16
     |  Main Functions
17
     | ------------------------------------------------------------------------------------------------
18
     */
19
    /**
20
     * Map routes.
21
     *
22
     * @param  \Illuminate\Contracts\Routing\Registrar  $router
23
     */
24 8
    public function map(Registrar $router)
25
    {
26 8
        $this->group([
27 8
            'prefix'    => 'categories',
28 6
            'as'        => 'categories.',
29
        ], function () {
30 8
            $this->get('/', [
31 8
                'as'   => 'index',         // blog::foundation.categories.index
32 6
                'uses' => 'CategoriesController@index',
33 6
            ]);
34
35 8
            $this->get('trash', [
36 8
                'as'   => 'trash',         // blog::foundation.categories.trash
37 6
                'uses' => 'CategoriesController@trash',
38 6
            ]);
39
40 8
            $this->get('create', [
41 8
                'as'   => 'create',        // blog::foundation.categories.create
42 6
                'uses' => 'CategoriesController@create',
43 6
            ]);
44
45 8
            $this->post('store', [
46 8
                'as'   => 'store',         // blog::foundation.categories.store
47 6
                'uses' => 'CategoriesController@store',
48 6
            ]);
49
50 8
            $this->group([
51 8
                'prefix' => '{blog_category_id}',
52
            ], function () {
53 8
                $this->get('/', [
54 8
                    'as'   => 'show',      // blog::foundation.categories.show
55 6
                    'uses' => 'CategoriesController@show',
56 6
                ]);
57
58 8
                $this->get('edit', [
59 8
                    'as'   => 'edit',      // blog::foundation.categories.edit
60 6
                    'uses' => 'CategoriesController@edit',
61 6
                ]);
62
63 8
                $this->put('update', [
64 8
                    'as'   => 'update',    // blog::foundation.categories.update
65 6
                    'uses' => 'CategoriesController@update',
66 6
                ]);
67
68 8
                $this->put('restore', [
69 8
                    'as'   => 'restore',   // blog::foundation.categories.restore
70 6
                    'uses' => 'CategoriesController@restore',
71 6
                ]);
72
73 8
                $this->delete('delete', [
74 8
                    'as'   => 'delete',    // blog::foundation.categories.delete
75 6
                    'uses' => 'CategoriesController@delete',
76 6
                ]);
77 8
            });
78 8
        });
79
80 8
        $this->bind('blog_category_id', function ($id) {
0 ignored issues
show
Bug introduced by
The method bind() does not seem to exist on object<Arcanesoft\Blog\H...ation\CategoriesRoutes>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
81
            return Category::findOrFail($id);
82 8
        });
83 8
    }
84
}
85