Completed
Push — master ( 8506a8...f27bf0 )
by Adam
06:27
created

UserTableService::getRouteName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
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
    public function getRouteName()
10
    {
11
        return 'user';
12
    }
13
14
    public function getColumns()
15
    {
16
        $dataset = [
17
            [
18
                'title' => trans('general.name'),
19
                'value' => function (User $data) {
20
                    return $data->name;
21
                },
22
            ],
23
            [
24
                'title' => trans('auth.email'),
25
                'value' => function (User $data) {
26
                    return $data->email;
27
                },
28
            ],
29
            [
30
                'title' => trans('general.created'),
31
                'value' => function (User $data) {
32
                    return $data->created_at;
33
                },
34
            ],
35
        ];
36
37
        return $dataset;
38
    }
39
}
40