Passed
Push — master ( f6e9eb...632a43 )
by Adam
05:07
created

UserTableService::getRouteName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace App\Services;
4
5
use App\Models\User;
6
7
class UserTableService implements TableServiceInterface
8
{
9 2
    public function getRouteName()
10
    {
11 2
        return 'user';
12
    }
13
14 2
    public function getColumns()
15
    {
16
        $dataset = [
17
            [
18 2
                'title' => trans('general.name'),
19 2
                'value' => function (User $data) {
20 1
                    return $data->name;
21 2
                },
22
            ],
23
            [
24 2
                'title' => trans('auth.email'),
25 2
                'value' => function (User $data) {
26 1
                    return $data->email;
27 2
                },
28
            ],
29
            [
30 2
                'title' => trans('general.created'),
31 2
                'value' => function (User $data) {
32 1
                    return $data->created_at;
33 2
                },
34
            ],
35
        ];
36
37 2
        return $dataset;
38
    }
39
}
40