fix default name

This commit is contained in:
2024-05-04 14:21:35 +10:00
parent 7b6e17ba40
commit 3358cf8dea
2 changed files with 5 additions and 1 deletions

View File

@@ -5,6 +5,10 @@
$onchange = $attributes->get('onchange'); $onchange = $attributes->get('onchange');
$value = old($name, $value); $value = old($name, $value);
$editor = filter_var($editor, FILTER_VALIDATE_BOOLEAN); $editor = filter_var($editor, FILTER_VALIDATE_BOOLEAN);
if($name === '') {
$name = \Illuminate\Support\Str::random(8);
}
@endphp @endphp
@if($value !== '' || $editor === true) @if($value !== '' || $editor === true)

View File

@@ -11,6 +11,6 @@
<article class="content mb-4">{!! $post->content !!}</article> <article class="content mb-4">{!! $post->content !!}</article>
<x-ui.gallery class="mt-16" value="{{ \App\Helpers::arrayToString($post->files('gallery')->pluck('name')->toArray()) }}" /> <x-ui.gallery class="mt-16" value="{{ \App\Helpers::arrayToString($post->files('gallery')->pluck('name')->toArray()) }}" />
<x-ui.filelist class="mt-16" label="Videos" value="{!! $post->files('videos')->orderBy('name')->get() !!}" /> <x-ui.filelist class="mt-16" label="Videos" value="{!! $post->files('videos')->orderBy('name')->get() !!}" />
<x-ui.filelist class="mt-16" value="{!! $post->files()->orderBy('name')->get() !!}" /> <x-ui.filelist class="mt-16" label="Files" value="{!! $post->files()->orderBy('name')->get() !!}" />
</x-container> </x-container>
</x-layout> </x-layout>