Skip to content

Commit 927cc2d

Browse files
committed
Extract out
1 parent 09448e6 commit 927cc2d

File tree

2 files changed

+36
-37
lines changed

2 files changed

+36
-37
lines changed

resources/views/includes/_body.blade.php

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -34,43 +34,7 @@ class="{{ $this->setTableDataClass($column->attribute, Arr::get($model->toArray(
3434
{{ $key }}="{{ $value }}"
3535
@endforeach
3636
>
37-
@if ($column->hasComponents())
38-
@if ($column->componentsAreHiddenForModel($model))
39-
@if ($message = $column->componentsHiddenMessageForModel($model))
40-
{{ $message }}
41-
@else
42-
 
43-
@endif
44-
@else
45-
@foreach($column->getComponents() as $component)
46-
@if (! $component->isHidden())
47-
@include($component->view(), ['model' => $model, 'attributes' => $component->getAttributes(), 'options' => $component->getOptions()])
48-
@endif
49-
@endforeach
50-
@endif
51-
@elseif ($column->isView())
52-
@include($column->view, [$column->getViewModelName() => $model])
53-
@else
54-
@if ($column->isHtml())
55-
@if ($column->isCustomAttribute())
56-
{{ new \Illuminate\Support\HtmlString(data_get($model, $column->attribute)) }}
57-
@else
58-
{{ new \Illuminate\Support\HtmlString(Arr::get($model->toArray(), $column->attribute)) }}
59-
@endif
60-
@elseif ($column->isUnescaped())
61-
@if ($column->isCustomAttribute())
62-
{!! data_get($model, $column->attribute) !!}
63-
@else
64-
{!! Arr::get($model->toArray(), $column->attribute) !!}
65-
@endif
66-
@else
67-
@if ($column->isCustomAttribute())
68-
{{ data_get($model, $column->attribute) }}
69-
@else
70-
{{ Arr::get($model->toArray(), $column->attribute) }}
71-
@endif
72-
@endif
73-
@endif
37+
@include('laravel-livewire-tables::includes._column-data')
7438
</td>
7539
@endforeach
7640

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@if ($column->hasComponents())
2+
@if ($column->componentsAreHiddenForModel($model))
3+
@if ($message = $column->componentsHiddenMessageForModel($model))
4+
{{ $message }}
5+
@endif
6+
@else
7+
@foreach($column->getComponents() as $component)
8+
@if (! $component->isHidden())
9+
@include($component->view(), ['model' => $model, 'attributes' => $component->getAttributes(), 'options' => $component->getOptions()])
10+
@endif
11+
@endforeach
12+
@endif
13+
@elseif ($column->isView())
14+
@include($column->view, [$column->getViewModelName() => $model])
15+
@else
16+
@if ($column->isHtml())
17+
@if ($column->isCustomAttribute())
18+
{{ new \Illuminate\Support\HtmlString(data_get($model, $column->attribute)) }}
19+
@else
20+
{{ new \Illuminate\Support\HtmlString(Arr::get($model->toArray(), $column->attribute)) }}
21+
@endif
22+
@elseif ($column->isUnescaped())
23+
@if ($column->isCustomAttribute())
24+
{!! data_get($model, $column->attribute) !!}
25+
@else
26+
{!! Arr::get($model->toArray(), $column->attribute) !!}
27+
@endif
28+
@else
29+
@if ($column->isCustomAttribute())
30+
{{ data_get($model, $column->attribute) }}
31+
@else
32+
{{ Arr::get($model->toArray(), $column->attribute) }}
33+
@endif
34+
@endif
35+
@endif

0 commit comments

Comments
 (0)