Completed
Push — master ( 5c46bf...f77784 )
by Mahmoud
03:22
created

RoutesServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 2
cbo 3
dl 0
loc 46
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 7 1
A map() 0 8 1
1
<?php
2
3
namespace App\Port\Route\Providers;
4
5
use App\Port\HashId\Traits\HashIdTrait;
6
use App\Port\Route\Abstracts\PortRoutesServiceProviderAbstract;
7
use App\Port\Route\Loaders\RoutesLoaderTrait;
8
use Dingo\Api\Routing\Router as DingoApiRouter;
9
use Illuminate\Routing\Router as LaravelRouter;
10
11
/**
12
 * Class RoutesServiceProvider.
13
 *
14
 * @author  Mahmoud Zalt <[email protected]>
15
 */
16
class RoutesServiceProvider extends PortRoutesServiceProviderAbstract
17
{
18
    use RoutesLoaderTrait;
19
    use HashIdTrait;
20
21
    /**
22
     * Instance of the Laravel default Router Class
23
     *
24
     * @var \Illuminate\Routing\Router
25
     */
26
    private $webRouter;
27
28
    /**
29
     * Instance of the Dingo Api router.
30
     *
31
     * @var \Dingo\Api\Routing\Router
32
     */
33
    public $apiRouter;
34
35
    /**
36
     * Define your route model bindings, pattern filters, etc.
37
     */
38
    public function boot()
39
    {
40
        // initializing an instance of the Dingo Api router
41
        $this->apiRouter = app(DingoApiRouter::class);
42
43
        parent::boot();
44
    }
45
46
    /**
47
     * Define the routes for the application.
48
     *
49
     * @param \Illuminate\Routing\Router $webRouter
50
     */
51
    public function map(LaravelRouter $webRouter)
52
    {
53
        $this->webRouter = $webRouter;
54
55
        $this->runRoutesAutoLoader();
56
57
        $this->runEndpointsHashedIdsDecoder();
58
    }
59
60
61
}
62