Skip to content

Commit

Permalink
docs(fields): helper methods for File field
Browse files Browse the repository at this point in the history
  • Loading branch information
DissNik committed Jun 17, 2024
1 parent 78a63e5 commit f22c655
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
29 changes: 29 additions & 0 deletions resources/views/pages/en/fields/file.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
['url' => '#customname', 'label' => 'Custom file name'],
['url' => '#names', 'label' => 'Element names'],
['url' => '#item-attributes', 'label' => 'Item attributes'],
['url' => '#helper-methods', 'label' => 'Helper methods'],
]
]"
>
Expand Down Expand Up @@ -430,4 +431,32 @@ public function fields(): array
//...
</x-code>

<x-sub-title id="helper-methods">Helper methods</x-sub-title>

<x-moonshine::divider label="getRemainingValues()" />

<x-p>
The <code>getRemainingValues()</code> method allows you to get the values that remained in the form,
taking into account the deletion.
</x-p>

<x-code language="php">
getRemainingValues()
</x-code>

<x-moonshine::divider label="removeExcludedFiles()" />

<x-p>
The <code>removeExcludedFiles()</code> method allows you to physically remove files during the process.
</x-p>

<x-code language="php">
removeExcludedFiles()
</x-code>

<x-moonshine::alert type="primary" icon="heroicons.outline.book-open">
Recipe: <x-link link="{{ to_page('recipes') }}#images-in-linked-table">saving images</x-link>
in the linked table.
</x-moonshine::alert>

</x-page>
29 changes: 29 additions & 0 deletions resources/views/pages/ru/fields/file.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
['url' => '#customname', 'label' => 'Произвольное имя файла'],
['url' => '#names', 'label' => 'Названия элементов'],
['url' => '#item-attributes', 'label' => 'Атрибуты элементов'],
['url' => '#helper-methods', 'label' => 'Вспомогательные методы'],
]
]"
>
Expand Down Expand Up @@ -430,4 +431,32 @@ public function fields(): array
//...
</x-code>

<x-sub-title id="helper-methods">Вспомогательные методы</x-sub-title>

<x-moonshine::divider label="getRemainingValues()" />

<x-p>
Метод <code>getRemainingValues()</code> позволяет получить значения
которые остались в форме с учетом удаления.
</x-p>

<x-code language="php">
getRemainingValues()
</x-code>

<x-moonshine::divider label="removeExcludedFiles()" />

<x-p>
Метод <code>removeExcludedFiles()</code> позволяет физически удалить файлы в процессе.
</x-p>

<x-code language="php">
removeExcludedFiles()
</x-code>

<x-moonshine::alert type="primary" icon="heroicons.outline.book-open">
Рецепт: <x-link link="{{ to_page('recipes') }}#images-in-linked-table">сохранение изображений</x-link>
в связанной таблице.
</x-moonshine::alert>

</x-page>

0 comments on commit f22c655

Please sign in to comment.