Completed
Push — develop ( 1e08ae...457e6c )
by Abdelrahman
02:25
created

StatisticsController::authorizeResource()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 12
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 6
nc 4
nop 4

1 Method

Rating   Name   Duplication   Size   Complexity  
A StatisticsController::index() 0 4 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 = [
0 ignored issues
show
Comprehensibility Naming introduced by
The variable name $resourceMethodsWithoutModels exceeds the maximum configured length of 20.

Very long variable names usually make code harder to read. It is therefore recommended not to make variable names too verbose.

Loading history...
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
            'phrase' => trans('cortex/statistics::common.agents'),
58
        ])->render('cortex/foundation::adminarea.pages.datatable');
59
    }
60
61
    /**
62
     * List all geoips.
63
     *
64
     * @param \Cortex\Statistics\DataTables\Adminarea\GeoipsDataTable $geoipsDataTable
65
     *
66
     * @return \Illuminate\Http\JsonResponse|\Illuminate\View\View
67
     */
68
    public function geoips(GeoipsDataTable $geoipsDataTable)
69
    {
70
        return $geoipsDataTable->with([
71
            'id' => 'adminarea-statistics-geoips-table',
72
            'phrase' => trans('cortex/statistics::common.geoips'),
73
        ])->render('cortex/foundation::adminarea.pages.datatable');
74
    }
75
76
    /**
77
     * List all devices.
78
     *
79
     * @param \Cortex\Statistics\DataTables\Adminarea\DevicesDataTable $devicesDataTable
80
     *
81
     * @return \Illuminate\Http\JsonResponse|\Illuminate\View\View
82
     */
83
    public function devices(DevicesDataTable $devicesDataTable)
84
    {
85
        return $devicesDataTable->with([
86
            'id' => 'adminarea-statistics-devices-table',
87
            'phrase' => trans('cortex/statistics::common.devices'),
88
        ])->render('cortex/foundation::adminarea.pages.datatable');
89
    }
90
91
    /**
92
     * List all paths.
93
     *
94
     * @param \Cortex\Statistics\DataTables\Adminarea\PathsDataTable $pathsDataTable
95
     *
96
     * @return \Illuminate\Http\JsonResponse|\Illuminate\View\View
97
     */
98
    public function paths(PathsDataTable $pathsDataTable)
99
    {
100
        return $pathsDataTable->with([
101
            'id' => 'adminarea-statistics-paths-table',
102
            'phrase' => trans('cortex/statistics::common.paths'),
103
        ])->render('cortex/foundation::adminarea.pages.datatable');
104
    }
105
106
    /**
107
     * List all platforms.
108
     *
109
     * @param \Cortex\Statistics\DataTables\Adminarea\PlatformsDataTable $platformsDataTable
110
     *
111
     * @return \Illuminate\Http\JsonResponse|\Illuminate\View\View
112
     */
113
    public function platforms(PlatformsDataTable $platformsDataTable)
114
    {
115
        return $platformsDataTable->with([
116
            'id' => 'adminarea-statistics-platforms-table',
117
            'phrase' => trans('cortex/statistics::common.platforms'),
118
        ])->render('cortex/foundation::adminarea.pages.datatable');
119
    }
120
121
    /**
122
     * List all requests.
123
     *
124
     * @param \Cortex\Statistics\DataTables\Adminarea\RequestsDataTable $requestsDataTable
125
     *
126
     * @return \Illuminate\Http\JsonResponse|\Illuminate\View\View
127
     */
128
    public function requests(RequestsDataTable $requestsDataTable)
129
    {
130
        return $requestsDataTable->with([
131
            'id' => 'adminarea-statistics-requests-table',
132
            'phrase' => trans('cortex/statistics::common.requests'),
133
        ])->render('cortex/foundation::adminarea.pages.datatable');
134
    }
135
136
    /**
137
     * List all routes.
138
     *
139
     * @param \Cortex\Statistics\DataTables\Adminarea\RoutesDataTable $routesDataTable
140
     *
141
     * @return \Illuminate\Http\JsonResponse|\Illuminate\View\View
142
     */
143
    public function routes(RoutesDataTable $routesDataTable)
144
    {
145
        return $routesDataTable->with([
146
            'id' => 'adminarea-statistics-routes-table',
147
            'phrase' => trans('cortex/statistics::common.routes'),
148
        ])->render('cortex/foundation::adminarea.pages.datatable');
149
    }
150
}
151