1
|
|
|
<?php namespace Arcanesoft\Media\Providers; |
2
|
|
|
|
3
|
|
|
use Arcanesoft\Core\Bases\RouteServiceProvider as ServiceProvider; |
4
|
|
|
use Arcanesoft\Media\Http\Routes; |
5
|
|
|
use Illuminate\Contracts\Routing\Registrar as Router; |
6
|
|
|
use Illuminate\Support\Arr; |
7
|
|
|
|
8
|
|
|
class RouteServiceProvider extends ServiceProvider |
9
|
|
|
{ |
10
|
|
|
/* ------------------------------------------------------------------------------------------------ |
11
|
|
|
| Getters & Setters |
12
|
|
|
| ------------------------------------------------------------------------------------------------ |
13
|
|
|
*/ |
14
|
|
|
/** |
15
|
|
|
* Get the routes namespace |
16
|
|
|
* |
17
|
|
|
* @return string |
18
|
|
|
*/ |
19
|
|
|
protected function getRouteNamespace() |
20
|
|
|
{ |
21
|
|
|
return 'Arcanesoft\\Media\\Http\\Routes'; |
22
|
|
|
} |
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
* Get the auth foundation route prefix. |
26
|
|
|
* |
27
|
|
|
* @return string |
28
|
|
|
*/ |
29
|
8 |
|
public function getFoundationAuthPrefix() |
30
|
|
|
{ |
31
|
8 |
|
$prefix = Arr::get($this->getFoundationRouteGroup(), 'prefix', 'dashboard'); |
32
|
|
|
|
33
|
8 |
|
return "$prefix/" . config('arcanesoft.media.route.prefix', 'media'); |
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
/* ------------------------------------------------------------------------------------------------ |
37
|
|
|
| Main Functions |
38
|
|
|
| ------------------------------------------------------------------------------------------------ |
39
|
|
|
*/ |
40
|
|
|
/** |
41
|
|
|
* Define the routes for the application. |
42
|
|
|
* |
43
|
|
|
* @param \Illuminate\Contracts\Routing\Registrar $router |
44
|
|
|
*/ |
45
|
8 |
|
public function map(Router $router) |
46
|
|
|
{ |
47
|
8 |
|
$this->mapAdminRoutes($router); |
48
|
8 |
|
} |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* Register the admin routes. |
52
|
|
|
* |
53
|
|
|
* @param \Illuminate\Contracts\Routing\Registrar $router |
54
|
|
|
*/ |
55
|
8 |
|
private function mapAdminRoutes(Router $router) |
56
|
|
|
{ |
57
|
8 |
|
$attributes = array_merge($this->getFoundationRouteGroup(), [ |
58
|
8 |
|
'as' => 'admin::media.', |
59
|
4 |
|
'namespace' => 'Arcanesoft\\Media\\Http\\Controllers\\Admin', |
60
|
4 |
|
]); |
61
|
|
|
|
62
|
8 |
|
$router->group(array_merge( |
63
|
4 |
|
$attributes, |
64
|
8 |
|
['prefix' => $this->getFoundationAuthPrefix()] |
65
|
8 |
|
), function (Router $router) { |
66
|
8 |
|
Routes\Admin\MediaRoutes::register($router); |
67
|
8 |
|
}); |
68
|
8 |
|
} |
69
|
|
|
} |
70
|
|
|
|