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