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

CategoriesRoutes::map()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 37
Code Lines 23

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 24
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 37
ccs 24
cts 25
cp 0.96
rs 8.8571
c 0
b 0
f 0
cc 1
eloc 23
nc 1
nop 0
crap 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