Completed
Push — master ( dc322e...438d0e )
by Mahmoud
03:27
created

RoutesProvider::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace App\Ship\Parents\Providers;
4
5
6
use App\Ship\Engine\Traits\HashIdTrait;
7
use App\Ship\Engine\Loaders\RoutesLoaderTrait;
8
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as LaravelRouteServiceProvider;
9
use Dingo\Api\Routing\Router as DingoApiRouter;
10
use Illuminate\Routing\Router as LaravelRouter;
11
12
/**
13
 * Class RoutesProvider.
14
 *
15
 * A.K.A app/Providers/RouteServiceProvider.php
16
 *
17
 * @author  Mahmoud Zalt <[email protected]>
18
 */
19
class RoutesProvider extends LaravelRouteServiceProvider
20
{
21
22
    use RoutesLoaderTrait;
23
    use HashIdTrait;
24
25
    /**
26
     * This namespace is applied to your controller routes.
27
     *
28
     * In addition, it is set as the URL generator's root namespace.
29
     *
30
     * @var string
31
     */
32
    protected $namespace;
33
34
    /**
35
     * Instance of the Laravel default Router Class
36
     *
37
     * @var \Illuminate\Routing\Router
38
     */
39
    private $webRouter;
40
41
    /**
42
     * Instance of the Dingo Api router.
43
     *
44
     * @var \Dingo\Api\Routing\Router
45
     */
46
    public $apiRouter;
47
48
    /**
49
     * Define your route model bindings, pattern filters, etc.
50
     */
51
    public function boot()
52
    {
53
        // initializing an instance of the Dingo Api router
54
        $this->apiRouter = app(DingoApiRouter::class);
55
56
        parent::boot();
57
    }
58
59
    /**
60
     * Define the routes for the application.
61
     *
62
     * @param \Illuminate\Routing\Router $webRouterParam
63
     */
64
    public function map(LaravelRouter $webRouterParam)
65
    {
66
        $this->webRouter = $webRouterParam;
67
68
        $this->runRoutesAutoLoader();
69
70
        $this->runEndpointsHashedIdsDecoder();
71
    }
72
73
}
74