Added XenForo route system and custom menu render.
This commit is contained in:
37
app/Livewire/EntryFilesModal.php
Normal file
37
app/Livewire/EntryFilesModal.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire;
|
||||
|
||||
use App\Models\Entry;
|
||||
use Livewire\Component;
|
||||
|
||||
class EntryFilesModal extends Component
|
||||
{
|
||||
|
||||
public bool $open = false;
|
||||
public ?int $entryId = null;
|
||||
|
||||
protected $listeners = [
|
||||
'entryOpenFilesModal' => 'openModal'
|
||||
];
|
||||
|
||||
public function openModal( int $entryId ): void
|
||||
{
|
||||
$this->entryId = $entryId;
|
||||
$this->open = true;
|
||||
|
||||
$this->dispatch('modal:opened');
|
||||
}
|
||||
|
||||
public function close(): void
|
||||
{
|
||||
$this->open = false;
|
||||
$this->entryId = null;
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
$files = $this->entryId ? Entry::find($this->entryId)?->files : collect();
|
||||
return view('livewire.entry-files-modal', compact('files'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user