aswi2020merlot-gitlab/app/Providers/RouteServiceProvider.php @ 8716927b
1 |
<?php
|
---|---|
2 |
|
3 |
namespace App\Providers; |
4 |
|
5 |
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; |
6 |
use Illuminate\Support\Facades\Route; |
7 |
|
8 |
class RouteServiceProvider extends ServiceProvider |
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 = 'App\Http\Controllers'; |
18 |
|
19 |
/**
|
20 |
* The path to the "home" route for your application.
|
21 |
*
|
22 |
* @var string
|
23 |
*/
|
24 |
public const HOME = '/artefact'; |
25 |
|
26 |
/**
|
27 |
* The path to categories.
|
28 |
*
|
29 |
* @var string
|
30 |
*/
|
31 |
public const CATEGORIES = '/categories'; |
32 |
|
33 |
/**
|
34 |
* Define your route model bindings, pattern filters, etc.
|
35 |
*
|
36 |
* @return void
|
37 |
*/
|
38 |
public function boot() |
39 |
{
|
40 |
//
|
41 |
|
42 |
parent::boot(); |
43 |
}
|
44 |
|
45 |
/**
|
46 |
* Define the routes for the application.
|
47 |
*
|
48 |
* @return void
|
49 |
*/
|
50 |
public function map() |
51 |
{
|
52 |
$this->mapApiRoutes(); |
53 |
|
54 |
$this->mapWebRoutes(); |
55 |
|
56 |
//
|
57 |
}
|
58 |
|
59 |
/**
|
60 |
* Define the "web" routes for the application.
|
61 |
*
|
62 |
* These routes all receive session state, CSRF protection, etc.
|
63 |
*
|
64 |
* @return void
|
65 |
*/
|
66 |
protected function mapWebRoutes() |
67 |
{
|
68 |
Route::middleware('web') |
69 |
->namespace($this->namespace) |
70 |
->group(base_path('routes/web.php')); |
71 |
}
|
72 |
|
73 |
/**
|
74 |
* Define the "api" routes for the application.
|
75 |
*
|
76 |
* These routes are typically stateless.
|
77 |
*
|
78 |
* @return void
|
79 |
*/
|
80 |
protected function mapApiRoutes() |
81 |
{
|
82 |
Route::prefix('api') |
83 |
->middleware('api') |
84 |
->namespace($this->namespace) |
85 |
->group(base_path('routes/api.php')); |
86 |
}
|
87 |
}
|
- « Předchozí
- 1
- …
- 3
- 4
- 5
- Další »