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

GuestTableService   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 43
ccs 0
cts 24
cp 0
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
B getColumns() 0 36 1
A getRouteName() 0 3 1
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