Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/Livewire/Photos/Gallery.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);
}

Expand Down
3 changes: 3 additions & 0 deletions app/Livewire/Photos/Uploader.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace App\Livewire\Photos;

use App\Livewire\Forms\PhotoForm;
use App\Models\Asset;
use Livewire\Component;
use Livewire\WithFileUploads;

Expand All @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion resources/views/livewire/photos/uploader.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<flux:separator />

<div>
<livewire:photos.gallery />
<livewire:photos.gallery :type="$this->galleryType" />
</div>
@endif
</flux:card>
Expand Down
1 change: 1 addition & 0 deletions resources/views/livewire/printing.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<livewire:photos.uploader
:header="'Upload 3D Prints'"
:showGallery="true"
:galleryType="App\Models\Asset::THREE_D_PRINTS"
/>
</div>
@endauth
Expand Down