1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Yaro\Jarboe\Table\Fields; |
4
|
|
|
|
5
|
|
|
use Illuminate\Http\Request; |
6
|
|
|
use Yaro\Jarboe\Table\Fields\Traits\BelongsToArray; |
7
|
|
|
use Yaro\Jarboe\Table\Fields\Traits\Clipboard; |
8
|
|
|
use Yaro\Jarboe\Table\Fields\Traits\Inline; |
9
|
|
|
use Yaro\Jarboe\Table\Fields\Traits\Maskable; |
10
|
|
|
use Yaro\Jarboe\Table\Fields\Traits\Maxlength; |
11
|
|
|
use Yaro\Jarboe\Table\Fields\Traits\Nullable; |
12
|
|
|
use Yaro\Jarboe\Table\Fields\Traits\Orderable; |
13
|
|
|
use Yaro\Jarboe\Table\Fields\Traits\Placeholder; |
14
|
|
|
use Yaro\Jarboe\Table\Fields\Traits\Tooltip; |
15
|
|
|
use Yaro\Jarboe\Table\Fields\Traits\Translatable; |
16
|
|
|
|
17
|
|
|
class Text extends AbstractField |
|
|
|
|
18
|
|
|
{ |
19
|
|
|
use Orderable; |
20
|
|
|
use Nullable; |
21
|
|
|
use Tooltip; |
22
|
|
|
use Clipboard; |
23
|
|
|
use Inline; |
24
|
|
|
use Translatable; |
25
|
|
|
use Maskable; |
26
|
|
|
use Placeholder; |
27
|
|
|
use Maxlength; |
28
|
|
|
use BelongsToArray; |
29
|
|
|
|
30
|
5 |
|
public function value(Request $request) |
31
|
|
|
{ |
32
|
5 |
|
$value = parent::value($request); |
33
|
5 |
|
if (is_null($value) && $this->isNullable()) { |
34
|
2 |
|
return null; |
35
|
|
|
} |
36
|
|
|
|
37
|
5 |
|
return is_array($value) ? $value : (string) $value; |
38
|
|
|
} |
39
|
|
|
|
40
|
2 |
|
public function getListView($model) |
41
|
|
|
{ |
42
|
2 |
|
$template = 'list'; |
43
|
2 |
|
if ($this->isTranslatable()) { |
44
|
1 |
|
$template .= '_translatable'; |
45
|
|
|
} |
46
|
|
|
|
47
|
2 |
|
return view('jarboe::crud.fields.text.'. $template, [ |
48
|
2 |
|
'model' => $model, |
49
|
2 |
|
'field' => $this, |
50
|
|
|
]); |
51
|
|
|
} |
52
|
|
|
|
53
|
1 |
|
public function getEditFormView($model) |
54
|
|
|
{ |
55
|
1 |
|
$template = $this->isReadonly() ? 'readonly' : 'edit'; |
56
|
|
|
|
57
|
1 |
|
return view('jarboe::crud.fields.text.'. $template, [ |
58
|
1 |
|
'model' => $model, |
59
|
1 |
|
'field' => $this, |
60
|
|
|
]); |
61
|
|
|
} |
62
|
|
|
|
63
|
1 |
|
public function getCreateFormView() |
64
|
|
|
{ |
65
|
1 |
|
$template = 'create'; |
66
|
|
|
|
67
|
1 |
|
return view('jarboe::crud.fields.text.'. $template, [ |
68
|
1 |
|
'field' => $this, |
69
|
|
|
]); |
70
|
|
|
} |
71
|
|
|
} |
72
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths