1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace App\Providers; |
4
|
|
|
|
5
|
|
|
use Illuminate\Support\Facades\Route; |
6
|
|
|
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; |
7
|
|
|
|
8
|
|
|
class RouteServiceProvider extends ServiceProvider |
9
|
|
|
{ |
10
|
|
|
/** |
11
|
|
|
* This namespace is applied to your controller routes. |
12
|
|
|
* In addition, it is set as the URL generator's root namespace. |
13
|
|
|
*/ |
14
|
|
|
protected $namespace = 'App\Http\Controllers'; |
15
|
|
|
public const HOME = '/dashboard'; |
16
|
|
|
|
17
|
|
|
/** |
18
|
|
|
* Define your route model bindings, pattern filters, etc. |
19
|
|
|
*/ |
20
|
423 |
|
public function boot() |
21
|
|
|
{ |
22
|
423 |
|
parent::boot(); |
23
|
423 |
|
} |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* Define the routes for the application. |
27
|
|
|
*/ |
28
|
423 |
|
public function map() |
29
|
|
|
{ |
30
|
|
|
// $this->mapApiRoutes(); |
31
|
423 |
|
$this->mapWebRoutes(); |
32
|
423 |
|
$this->mapUserRoutes(); |
33
|
423 |
|
$this->mapAdminRoutes(); |
34
|
423 |
|
$this->mapCustomerRoutes(); |
35
|
423 |
|
} |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* Define the basic web routes for the application. |
39
|
|
|
*/ |
40
|
423 |
|
protected function mapWebRoutes() |
41
|
|
|
{ |
42
|
423 |
|
Route::middleware('web') |
43
|
423 |
|
->namespace($this->namespace) |
44
|
423 |
|
->group(base_path('routes/web.php')); |
45
|
423 |
|
} |
46
|
|
|
|
47
|
423 |
|
protected function mapUserRoutes() |
48
|
|
|
{ |
49
|
423 |
|
Route::middleware('web') |
50
|
423 |
|
->namespace($this->namespace) |
51
|
423 |
|
->group(base_path('routes/user.php')); |
52
|
423 |
|
} |
53
|
|
|
|
54
|
423 |
|
protected function mapAdminRoutes() |
55
|
|
|
{ |
56
|
423 |
|
Route::middleware('web') |
57
|
423 |
|
->namespace($this->namespace) |
58
|
423 |
|
->group(base_path('routes/administration.php')); |
59
|
423 |
|
} |
60
|
|
|
|
61
|
423 |
|
protected function mapCustomerRoutes() |
62
|
|
|
{ |
63
|
423 |
|
Route::middleware('web') |
64
|
423 |
|
->namespace($this->namespace) |
65
|
423 |
|
->group(base_path('routes/customers.php')); |
66
|
423 |
|
} |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* Define the "api" routes for the application. |
70
|
|
|
* These routes are typically stateless. |
71
|
|
|
*/ |
72
|
|
|
// protected function mapApiRoutes() |
73
|
|
|
// { |
74
|
|
|
// Route::prefix('api') |
75
|
|
|
// ->middleware('api') |
76
|
|
|
// ->namespace($this->namespace) |
77
|
|
|
// ->group(base_path('routes/api.php')); |
78
|
|
|
// } |
79
|
|
|
} |
80
|
|
|
|