From ba29607d25361ee3069bc93f7ee33845541c91f0 Mon Sep 17 00:00:00 2001 From: kyledoesdev Date: Thu, 17 Jul 2025 19:35:02 -0400 Subject: [PATCH] Fix gallery type for 3d print admin --- app/Livewire/Photos/Gallery.php | 4 ++-- app/Livewire/Photos/Uploader.php | 3 +++ resources/views/livewire/photos/uploader.blade.php | 2 +- resources/views/livewire/printing.blade.php | 1 + 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/Livewire/Photos/Gallery.php b/app/Livewire/Photos/Gallery.php index c9c9a4d..12d609f 100644 --- a/app/Livewire/Photos/Gallery.php +++ b/app/Livewire/Photos/Gallery.php @@ -17,7 +17,7 @@ class Gallery extends Component public string $emptyMessage = 'No Photos'; - public int $type = Asset::PHOTO; + public array|int $type = Asset::PHOTO; public PhotoForm $form; @@ -31,7 +31,7 @@ public function render() public function photos() { return Asset::query() - ->where('type_id', $this->type) + ->whereIn('type_id', is_array($this->type) ? $this->type : [$this->type]) ->paginate(6); } diff --git a/app/Livewire/Photos/Uploader.php b/app/Livewire/Photos/Uploader.php index 03cc4c8..bcea0b0 100644 --- a/app/Livewire/Photos/Uploader.php +++ b/app/Livewire/Photos/Uploader.php @@ -3,6 +3,7 @@ namespace App\Livewire\Photos; use App\Livewire\Forms\PhotoForm; +use App\Models\Asset; use Livewire\Component; use Livewire\WithFileUploads; @@ -16,6 +17,8 @@ class Uploader extends Component public bool $showGallery = true; + public array|int $galleryType = Asset::PHOTO; + public function render() { return view('livewire.photos.uploader'); diff --git a/resources/views/livewire/photos/uploader.blade.php b/resources/views/livewire/photos/uploader.blade.php index cbe634d..1d28c80 100644 --- a/resources/views/livewire/photos/uploader.blade.php +++ b/resources/views/livewire/photos/uploader.blade.php @@ -29,7 +29,7 @@
- +
@endif diff --git a/resources/views/livewire/printing.blade.php b/resources/views/livewire/printing.blade.php index 93a2139..9636993 100644 --- a/resources/views/livewire/printing.blade.php +++ b/resources/views/livewire/printing.blade.php @@ -8,6 +8,7 @@ @endauth