1
|
|
|
<?php namespace Arcanesoft\Blog\Providers; |
2
|
|
|
|
3
|
|
|
use Arcanesoft\Blog\Http\Routes; |
4
|
|
|
use Arcanesoft\Core\Bases\RouteServiceProvider as ServiceProvider; |
5
|
|
|
use Illuminate\Contracts\Routing\Registrar as Router; |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* Class RouteServiceProvider |
9
|
|
|
* |
10
|
|
|
* @package Arcanesoft\Blog\Providers |
11
|
|
|
* @author ARCANEDEV <[email protected]> |
12
|
|
|
*/ |
13
|
|
|
class RouteServiceProvider extends ServiceProvider |
14
|
|
|
{ |
15
|
|
|
/* ------------------------------------------------------------------------------------------------ |
16
|
|
|
| Main Functions |
17
|
|
|
| ------------------------------------------------------------------------------------------------ |
18
|
|
|
*/ |
19
|
|
|
/** |
20
|
|
|
* Define the routes for the application. |
21
|
|
|
* |
22
|
|
|
* @param \Illuminate\Contracts\Routing\Registrar $router |
23
|
|
|
*/ |
24
|
6 |
|
public function map(Router $router) |
25
|
|
|
{ |
26
|
6 |
|
$this->mapAdminRoutes($router); |
27
|
6 |
|
$this->mapPublicRoutes($router); |
28
|
6 |
|
} |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* Define the foundation routes for the application. |
32
|
|
|
* |
33
|
|
|
* @param \Illuminate\Contracts\Routing\Registrar $router |
34
|
|
|
*/ |
35
|
6 |
|
private function mapAdminRoutes(Router $router) |
36
|
|
|
{ |
37
|
6 |
|
$attributes = $this->getAdminAttributes( |
38
|
6 |
|
'blog.', |
39
|
6 |
|
'Arcanesoft\\Blog\\Http\\Controllers\\Admin', |
40
|
6 |
|
$this->config()->get('arcanesoft.blog.route.prefix', 'blog') |
41
|
2 |
|
); |
42
|
|
|
|
43
|
|
|
$router->group($attributes, function ($router) { |
44
|
6 |
|
Routes\Admin\StatsRoutes::register($router); |
45
|
6 |
|
Routes\Admin\PostsRoutes::register($router); |
46
|
6 |
|
Routes\Admin\CommentsRoutes::register($router); |
47
|
6 |
|
Routes\Admin\CategoriesRoutes::register($router); |
48
|
6 |
|
Routes\Admin\TagsRoutes::register($router); |
49
|
6 |
|
}); |
50
|
6 |
|
} |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* Define the public routes for the application. |
54
|
|
|
* |
55
|
|
|
* @param \Illuminate\Contracts\Routing\Registrar $router |
56
|
|
|
*/ |
57
|
6 |
|
private function mapPublicRoutes(Router $router) |
58
|
|
|
{ |
59
|
|
|
$attributes = [ |
60
|
6 |
|
'as' => 'public::blog.', |
61
|
2 |
|
'prefix' => 'blog', |
62
|
2 |
|
'middleware' => 'web', |
63
|
2 |
|
'namespace' => 'Arcanesoft\\Blog\\Http\\Controllers\\Front', |
64
|
2 |
|
]; |
65
|
|
|
|
66
|
6 |
|
$router->group($attributes, function ($router) { |
67
|
6 |
|
Routes\Front\PostsRoutes::register($router); |
68
|
6 |
|
Routes\Front\CategoriesRoutes::register($router); |
69
|
6 |
|
Routes\Front\TagsRoutes::register($router); |
70
|
6 |
|
}); |
71
|
6 |
|
} |
72
|
|
|
} |
73
|
|
|
|