1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Diglabby\Doika\Providers; |
4
|
|
|
|
5
|
|
|
use App\Providers\RouteServiceProvider as BasicRouteServiceProvider; |
6
|
|
|
use Illuminate\Support\Facades\Route; |
7
|
|
|
|
8
|
|
|
final class RouteServiceProvider extends BasicRouteServiceProvider |
9
|
|
|
{ |
10
|
|
|
/** |
11
|
|
|
* This namespace is applied to your controller routes. |
12
|
|
|
* |
13
|
|
|
* In addition, it is set as the URL generator's root namespace. |
14
|
|
|
* |
15
|
|
|
* @var string |
16
|
|
|
*/ |
17
|
|
|
protected $namespace = 'Diglabby\Doika\Http\Controllers'; |
18
|
|
|
|
19
|
|
|
/** @var string */ |
20
|
|
|
protected $laravelNamespace = 'App\Http\Controllers'; |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* Define the routes for the application. |
24
|
|
|
* |
25
|
|
|
* @return void |
26
|
|
|
*/ |
27
|
|
|
public function map() |
28
|
|
|
{ |
29
|
|
|
$this->mapWidgetRoutes(); |
30
|
|
|
$this->mapDashboardRoutes(); |
31
|
|
|
$this->mapRedirectRoutes(); |
32
|
|
|
} |
33
|
|
|
|
34
|
|
|
protected function mapWidgetRoutes() |
35
|
|
|
{ |
36
|
|
|
Route::middleware('web') |
37
|
|
|
->prefix('doika') |
38
|
|
|
->namespace($this->namespace) |
39
|
|
|
->group(base_path('routes/widget.php')); |
40
|
|
|
} |
41
|
|
|
|
42
|
|
|
protected function mapDashboardRoutes() |
43
|
|
|
{ |
44
|
|
|
Route::middleware(['web']) |
45
|
|
|
->prefix('doika/dashboard/') |
46
|
|
|
->namespace($this->laravelNamespace) |
47
|
|
|
->group(base_path('routes/auth.php')); |
48
|
|
|
|
49
|
|
|
Route::middleware(['web', 'auth']) |
50
|
|
|
->prefix('doika/dashboard/') |
51
|
|
|
->namespace($this->namespace) |
52
|
|
|
->group(base_path('routes/dashboard.php')); |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
protected function mapRedirectRoutes() |
56
|
|
|
{ |
57
|
|
|
Route::middleware(['web']) |
58
|
|
|
->namespace($this->namespace) |
59
|
|
|
->group(base_path('routes/redirects.php')); |
60
|
|
|
} |
61
|
|
|
} |
62
|
|
|
|