Completed
Pull Request — master (#14)
by
unknown
15:13 queued 07:44
created

DummyField::getEditFormView()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.9666
c 0
b 0
f 0
ccs 5
cts 5
cp 1
cc 2
nc 2
nop 1
crap 2
1
<?php
2
3
namespace Yaro\Jarboe\Table\Fields\Markup;
4
5
use Illuminate\Http\Request;
6
use Yaro\Jarboe\Table\Fields\AbstractField;
7
8
class DummyField extends AbstractField
9
{
10
    protected $hidden = [
11
        'list'   => true,
12
        'edit'   => false,
13
        'create' => false,
14
    ];
15
16 1
    public function shouldSkip(Request $request)
17
    {
18 1
        return true;
19
    }
20
21 1
    public function getListView($model)
22
    {
23 1
        return view('jarboe::crud.fields.markup.dummy.list', [
24 1
            'model' => $model,
25 1
            'field' => $this,
26
        ]);
27
    }
28
29 1
    public function getEditFormView($model)
30
    {
31 1
        $template = $this->isReadonly() ? 'readonly' : 'edit';
32
33 1
        return view('jarboe::crud.fields.markup.dummy.'. $template, [
34 1
            'model' => $model,
35 1
            'field' => $this,
36
        ]);
37
    }
38
39 1
    public function getCreateFormView()
40
    {
41 1
        return view('jarboe::crud.fields.markup.dummy.create', [
42 1
            'field' => $this,
43
        ]);
44
    }
45
}
46