Completed
Push — master ( 89f851...121c16 )
by Adam
09:13
created

GuestTableService::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
namespace App\Services;
3
4
use App\Models\Guest;
5
6
class GuestTableService implements TableServiceInterface
7
{
8
    public function getRouteName()
9
    {
10
        return 'guest';
11
    }
12
13
    public function getColumns()
14
    {
15
        $dataset = [
16
            [
17
                'title' => trans('general.first_name'),
18
                'value' => function (Guest $data) {
19
                    return $data->first_name;
20
                },
21
            ],
22
            [
23
                'title' => trans('general.last_name'),
24
                'value' => function (Guest $data) {
25
                    return $data->last_name;
26
                },
27
            ],
28
            [
29
                'title' => trans('general.address'),
30
                'value' => function (Guest $data) {
31
                    return $data->address.', '.$data->zip_code.' '.$data->place;
32
                },
33
            ],
34
            [
35
                'title' => trans('general.PESEL'),
36
                'value' => function (Guest $data) {
37
                    return $data->PESEL;
38
                },
39
            ],
40
            [
41
                'title' => trans('general.contact'),
42
                'value' => function (Guest $data) {
43
                    return $data->contact;
44
                },
45
            ],
46
        ];
47
48
        return $dataset;
49
    }
50
}
51