StatisticsController   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 128
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 8

Importance

Changes 0
Metric Value
wmc 8
lcom 0
cbo 8
dl 0
loc 128
rs 10
c 0
b 0
f 0

8 Methods

Rating   Name   Duplication   Size   Complexity  
A index() 0 4 1
A agents() 0 6 1
A geoips() 0 6 1
A devices() 0 6 1
A paths() 0 6 1
A platforms() 0 6 1
A requests() 0 6 1
A routes() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Cortex\Statistics\Http\Controllers\Adminarea;
6
7
use Cortex\Statistics\DataTables\Adminarea\PathsDataTable;
8
use Cortex\Statistics\DataTables\Adminarea\AgentsDataTable;
9
use Cortex\Statistics\DataTables\Adminarea\GeoipsDataTable;
10
use Cortex\Statistics\DataTables\Adminarea\RoutesDataTable;
11
use Cortex\Foundation\Http\Controllers\AuthorizedController;
12
use Cortex\Statistics\DataTables\Adminarea\DevicesDataTable;
13
use Cortex\Statistics\DataTables\Adminarea\RequestsDataTable;
14
use Cortex\Statistics\DataTables\Adminarea\PlatformsDataTable;
15
16
class StatisticsController extends AuthorizedController
17
{
18
    /**
19
     * {@inheritdoc}
20
     */
21
    protected $resource = 'list-statistics';
22
23
    /**
24
     * {@inheritdoc}
25
     */
26
    protected $resourceMethodsWithoutModels = [
27
        'agents',
28
        'geoips',
29
        'devices',
30
        'paths',
31
        'platforms',
32
        'requests',
33
        'routes',
34
    ];
35
36
    /**
37
     * Show statistics index.
38
     *
39
     * @return \Illuminate\View\View
40
     */
41
    public function index()
42
    {
43
        return view('cortex/foundation::adminarea.pages.index');
44
    }
45
46
    /**
47
     * List all agents.
48
     *
49
     * @param \Cortex\Statistics\DataTables\Adminarea\AgentsDataTable $agentsDataTable
50
     *
51
     * @return \Illuminate\Http\JsonResponse|\Illuminate\View\View
52
     */
53
    public function agents(AgentsDataTable $agentsDataTable)
54
    {
55
        return $agentsDataTable->with([
56
            'id' => 'adminarea-statistics-agents-table',
57
        ])->render('cortex/foundation::adminarea.pages.datatable-index');
58
    }
59
60
    /**
61
     * List all geoips.
62
     *
63
     * @param \Cortex\Statistics\DataTables\Adminarea\GeoipsDataTable $geoipsDataTable
64
     *
65
     * @return \Illuminate\Http\JsonResponse|\Illuminate\View\View
66
     */
67
    public function geoips(GeoipsDataTable $geoipsDataTable)
68
    {
69
        return $geoipsDataTable->with([
70
            'id' => 'adminarea-statistics-geoips-table',
71
        ])->render('cortex/foundation::adminarea.pages.datatable-index');
72
    }
73
74
    /**
75
     * List all devices.
76
     *
77
     * @param \Cortex\Statistics\DataTables\Adminarea\DevicesDataTable $devicesDataTable
78
     *
79
     * @return \Illuminate\Http\JsonResponse|\Illuminate\View\View
80
     */
81
    public function devices(DevicesDataTable $devicesDataTable)
82
    {
83
        return $devicesDataTable->with([
84
            'id' => 'adminarea-statistics-devices-table',
85
        ])->render('cortex/foundation::adminarea.pages.datatable-index');
86
    }
87
88
    /**
89
     * List all paths.
90
     *
91
     * @param \Cortex\Statistics\DataTables\Adminarea\PathsDataTable $pathsDataTable
92
     *
93
     * @return \Illuminate\Http\JsonResponse|\Illuminate\View\View
94
     */
95
    public function paths(PathsDataTable $pathsDataTable)
96
    {
97
        return $pathsDataTable->with([
98
            'id' => 'adminarea-statistics-paths-table',
99
        ])->render('cortex/foundation::adminarea.pages.datatable-index');
100
    }
101
102
    /**
103
     * List all platforms.
104
     *
105
     * @param \Cortex\Statistics\DataTables\Adminarea\PlatformsDataTable $platformsDataTable
106
     *
107
     * @return \Illuminate\Http\JsonResponse|\Illuminate\View\View
108
     */
109
    public function platforms(PlatformsDataTable $platformsDataTable)
110
    {
111
        return $platformsDataTable->with([
112
            'id' => 'adminarea-statistics-platforms-table',
113
        ])->render('cortex/foundation::adminarea.pages.datatable-index');
114
    }
115
116
    /**
117
     * List all requests.
118
     *
119
     * @param \Cortex\Statistics\DataTables\Adminarea\RequestsDataTable $requestsDataTable
120
     *
121
     * @return \Illuminate\Http\JsonResponse|\Illuminate\View\View
122
     */
123
    public function requests(RequestsDataTable $requestsDataTable)
124
    {
125
        return $requestsDataTable->with([
126
            'id' => 'adminarea-statistics-requests-table',
127
        ])->render('cortex/foundation::adminarea.pages.datatable-index');
128
    }
129
130
    /**
131
     * List all routes.
132
     *
133
     * @param \Cortex\Statistics\DataTables\Adminarea\RoutesDataTable $routesDataTable
134
     *
135
     * @return \Illuminate\Http\JsonResponse|\Illuminate\View\View
136
     */
137
    public function routes(RoutesDataTable $routesDataTable)
138
    {
139
        return $routesDataTable->with([
140
            'id' => 'adminarea-statistics-routes-table',
141
        ])->render('cortex/foundation::adminarea.pages.datatable-index');
142
    }
143
}
144