Skip to content

Commit

Permalink
fixed Field hideOnForm
Browse files Browse the repository at this point in the history
  • Loading branch information
lee-to committed Jun 19, 2022
1 parent 1582879 commit 4c67c3d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion resources/views/base/form/form.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class="py-4 px-6 block focus:outline-none text-purple">
@foreach($resource->fields() as $field)
@if($field instanceof \Leeto\MoonShine\Decorations\Decoration)
{{ $resource->renderDecoration($field, $item) }}
@else
@elseif($field instanceof \Leeto\MoonShine\Fields\Field && $field->showOnForm)
<x-moonshine::field-container :field="$field" :item="$item" :resource="$resource">
{{ $resource->renderField($field, $item) }}
</x-moonshine::field-container>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/decorations/tab.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@foreach($decoration->fields() as $field)
@if($field instanceof \Leeto\MoonShine\Decorations\Decoration)
{{ $resource->renderDecoration($field, $item) }}
@else
@elseif($field instanceof \Leeto\MoonShine\Fields\Field && $field->showOnForm)
<x-moonshine::field-container :field="$field" :item="$item" :resource="$resource">
{{ $resource->renderField($field, $item) }}
</x-moonshine::field-container>
Expand Down
2 changes: 1 addition & 1 deletion src/Fields/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function showOnForm(): static

public function hideOnForm(): static
{
$this->showOnForm = true;
$this->showOnForm = false;

return $this;
}
Expand Down

0 comments on commit 4c67c3d

Please sign in to comment.