RoutesDataTable   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 34
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getColumns() 0 11 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Cortex\Statistics\DataTables\Adminarea;
6
7
use Rinvex\Statistics\Models\Route;
8
use Cortex\Foundation\DataTables\AbstractDataTable;
9
use Cortex\Statistics\Transformers\Adminarea\RouteTransformer;
10
11
class RoutesDataTable extends AbstractDataTable
12
{
13
    /**
14
     * {@inheritdoc}
15
     */
16
    protected $model = Route::class;
17
18
    /**
19
     * {@inheritdoc}
20
     */
21
    protected $transformer = RouteTransformer::class;
22
23
    /**
24
     * {@inheritdoc}
25
     */
26
    protected $createButton = false;
27
28
    /**
29
     * Get columns.
30
     *
31
     * @return array
32
     */
33
    protected function getColumns(): array
34
    {
35
        return [
36
            'name' => ['title' => trans('cortex/statistics::common.name'), 'responsivePriority' => 0],
37
            'path' => ['title' => trans('cortex/statistics::common.path')],
38
            'action' => ['title' => trans('cortex/statistics::common.action')],
39
            'middleware' => ['title' => trans('cortex/statistics::common.middleware'), 'visible' => false],
40
            'parameters' => ['title' => trans('cortex/statistics::common.parameters'), 'visible' => false, 'render' => 'data ? JSON.stringify(data) : ""'],
41
            'count' => ['title' => trans('cortex/statistics::common.count')],
42
        ];
43
    }
44
}
45