| Code Coverage
| Classes and Traits | Functions and Methods | Lines
Total | 100.00% covered (success) | 100.00% | 1 / 1 | 100.00% covered (success) | 100.00% | 4 / 4 | CRAP | 100.00% covered (success) | 100.00% | 18 / 18
RouteServiceProvider | 100.00% covered (success) | 100.00% | 1 / 1 | 100.00% covered (success) | 100.00% | 4 / 4 | 4 | 100.00% covered (success) | 100.00% | 18 / 18
boot | 100.00% covered (success) | 100.00% | 1 / 1 | 1 | 100.00% covered (success) | 100.00% | 2 / 2
map | 100.00% covered (success) | 100.00% | 1 / 1 | 1 | 100.00% covered (success) | 100.00% | 3 / 3
mapWebRoutes | 100.00% covered (success) | 100.00% | 1 / 1 | 1 | 100.00% covered (success) | 100.00% | 4 / 4
$this\mapApiRoutes | 100.00% covered (success) | 100.00% | 1 / 1 | 1 | 100.00% covered (success) | 100.00% | 9 / 9

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 | *
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 | * Define your route model bindings, pattern filters, etc.
21 | *
22 | * @return void
23 | */
24 | public function boot()
25 | {
26 | //
27 |
28 | parent::boot();
29 | }
30 |
31 | /**
32 | * Define the routes for the application.
33 | *
34 | * @return void
35 | */
36 | public function map()
37 | {
38 | $this->mapApiRoutes();
39 |
40 | $this->mapWebRoutes();
41 |
42 | //
43 | }
44 |
45 | /**
46 | * Define the "web" routes for the application.
47 | *
48 | * These routes all receive session state, CSRF protection, etc.
49 | *
50 | * @return void
51 | */
52 | protected function mapWebRoutes()
53 | {
54 | Route::middleware('web')
55 | ->namespace($this->namespace)
56 | ->group(base_path('routes/web.php'));
57 | Route::namespace($this->namespace)
58 | ->group(base_path('routes/plain.php'));
59 | }
60 |
61 | /**
62 | * Define the "api" routes for the application.
63 | *
64 | * These routes are typically stateless.
65 | *
66 | * @return void
67 | */
68 | protected function mapApiRoutes()
69 | {
70 | Route::prefix('api')
71 | ->middleware('api')
72 | ->namespace($this->namespace)
73 | ->group(base_path('routes/api.php'));
74 | Route::prefix('apiLocal')
75 | ->middleware('apiLocal')
76 | ->namespace($this->namespace)
77 | ->group(base_path('routes/apiLocal.php'));
78 | }
79 | }