Completed
Push — master ( c6395c...b2af6e )
by ARCANEDEV
04:21
created

CategoriesRoutes   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 96%

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 1
dl 0
loc 47
ccs 24
cts 25
cp 0.96
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B map() 0 37 1
1
<?php namespace Arcanesoft\Blog\Http\Routes\Admin;
2
3
use Arcanedev\Support\Routing\RouteRegistrar;
4
use Arcanesoft\Blog\Models\Category;
5
6
/**
7
 * Class     CategoriesRoutes
8
 *
9
 * @package  Arcanesoft\Blog\Http\Routes\Admin
10
 * @author   ARCANEDEV <[email protected]>
11
 */
12
class CategoriesRoutes extends RouteRegistrar
13
{
14
    /* ------------------------------------------------------------------------------------------------
15
     |  Main Functions
16
     | ------------------------------------------------------------------------------------------------
17
     */
18
    /**
19
     * Map routes.
20
     */
21 6
    public function map()
22
    {
23
        $this->prefix('categories')->name('categories.')->group(function () {
24 6
            $this->get('/', 'CategoriesController@index')
25 6
                 ->name('index');       // admin::blog.categories.index
26
27 6
            $this->get('trash', 'CategoriesController@trash')
28 6
                 ->name('trash');       // admin::blog.categories.trash
29
30 6
            $this->get('create', 'CategoriesController@create')
31 6
                 ->name('create');      // admin::blog.categories.create
32
33 6
            $this->post('store', 'CategoriesController@store')
34 6
                 ->name('store');       // admin::blog.categories.store
35
36
            $this->prefix('{blog_category}')->group(function () {
37 6
                $this->get('/', 'CategoriesController@show')
38 6
                     ->name('show');    // admin::blog.categories.show
39
40 6
                $this->get('edit', 'CategoriesController@edit')
41 6
                    ->name('edit');     // admin::blog.categories.edit
42
43 6
                $this->put('update', 'CategoriesController@update')
44 6
                     ->name('update');  // admin::blog.categories.update
45
46 6
                $this->put('restore', 'CategoriesController@restore')
47 6
                     ->name('restore'); // admin::blog.categories.restore
48
49 6
                $this->delete('delete', 'CategoriesController@delete')
50 6
                     ->name('delete'); // admin::blog.categories.delete
51 6
            });
52 6
        });
53
54 6
        $this->bind('blog_category', function ($id) {
55
            return Category::withTrashed()->findOrFail($id);
0 ignored issues
show
Bug introduced by
The method withTrashed() does not exist on Arcanesoft\Blog\Models\Category. Did you maybe mean trashed()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
56 6
        });
57 6
    }
58
}
59