KTVCentral/app/Livewire/Modals/StickerModal.php
allen.yan ef865b50e1 20250902
移除使用的密碼記錄
加入手機點歌介面
加入 ftp驗証
2025-09-02 11:25:28 +08:00

45 lines
977 B
PHP

<?php
namespace App\Livewire\Modals;
use Livewire\Component;
class StickerModal extends Component
{
protected $listeners = [
'openModal','closeModal'
];
public bool $showModal = false;
public $selectedSticker = null;
public $stickers = [];
public function mount()
{
$this->stickers = collect(glob(storage_path('app/public/superstar-pic/*.png')))
//->map(fn($path) => 'superstar-pic/' . basename($path))
->map(fn($path) => basename($path))
->toArray();
}
public function openModal()
{
$this->showModal = true;
}
public function closeModal()
{
$this->showModal = false;
}
public function select($sticker)
{
$this->dispatch('stickerSelected', $sticker);
$this->selectedSticker =$sticker;
$this->showModal = false;
}
public function render()
{
return view('livewire.modals.sticker-modal');
}
}