|
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 Methods |
|
16
|
|
|
| ----------------------------------------------------------------- |
|
17
|
|
|
*/ |
|
18
|
|
|
|
|
19
|
|
|
/** |
|
20
|
|
|
* Route bindings. |
|
21
|
|
|
*/ |
|
22
|
14 |
|
public static function bindings() |
|
23
|
|
|
{ |
|
24
|
28 |
|
(new static)->bind('blog_category', function ($id) { |
|
25
|
|
|
return Category::query()->withTrashed()->findOrFail($id); |
|
26
|
42 |
|
}); |
|
27
|
42 |
|
} |
|
28
|
|
|
|
|
29
|
|
|
/** |
|
30
|
|
|
* Map routes. |
|
31
|
|
|
*/ |
|
32
|
14 |
|
public function map() |
|
33
|
|
|
{ |
|
34
|
28 |
|
$this->prefix('categories')->name('categories.')->group(function () { |
|
35
|
42 |
|
$this->get('/', 'CategoriesController@index') |
|
36
|
42 |
|
->name('index'); // admin::blog.categories.index |
|
37
|
|
|
|
|
38
|
42 |
|
$this->get('trash', 'CategoriesController@trash') |
|
39
|
42 |
|
->name('trash'); // admin::blog.categories.trash |
|
40
|
|
|
|
|
41
|
42 |
|
$this->get('create', 'CategoriesController@create') |
|
42
|
42 |
|
->name('create'); // admin::blog.categories.create |
|
43
|
|
|
|
|
44
|
42 |
|
$this->post('store', 'CategoriesController@store') |
|
45
|
42 |
|
->name('store'); // admin::blog.categories.store |
|
46
|
|
|
|
|
47
|
42 |
|
$this->prefix('{blog_category}')->group(function () { |
|
48
|
42 |
|
$this->get('/', 'CategoriesController@show') |
|
49
|
42 |
|
->name('show'); // admin::blog.categories.show |
|
50
|
|
|
|
|
51
|
42 |
|
$this->get('edit', 'CategoriesController@edit') |
|
52
|
42 |
|
->name('edit'); // admin::blog.categories.edit |
|
53
|
|
|
|
|
54
|
42 |
|
$this->put('update', 'CategoriesController@update') |
|
55
|
42 |
|
->name('update'); // admin::blog.categories.update |
|
56
|
|
|
|
|
57
|
42 |
|
$this->put('restore', 'CategoriesController@restore') |
|
58
|
42 |
|
->middleware('ajax') |
|
59
|
42 |
|
->name('restore'); // admin::blog.categories.restore |
|
60
|
|
|
|
|
61
|
42 |
|
$this->delete('delete', 'CategoriesController@delete') |
|
62
|
42 |
|
->middleware('ajax') |
|
63
|
42 |
|
->name('delete'); // admin::blog.categories.delete |
|
64
|
42 |
|
}); |
|
65
|
14 |
|
}); |
|
66
|
14 |
|
} |
|
67
|
|
|
} |
|
68
|
|
|
|