Files
eatvio-infra/app/Livewire/Recipe/Comment/Show.php
2023-12-28 17:07:09 +03:00

28 lines
700 B
PHP

<?php
namespace App\Livewire\Recipe\Comment;
use App\Models\Recipe;
use Livewire\Component;
class Show extends Component
{
public Recipe $recipe;
public array $tabpanelState = ['positive' => 'positive', 'negative' => false];
protected $listeners = ['commentAdded' => '$refresh'];
public function render()
{
return view('livewire.recipe.comment.show');
}
public function toggleTabpanelState($tabpanelName)
{
collect($this->tabpanelState)->keys()->map(fn ($key) => $key === $tabpanelName
? $this->tabpanelState[$tabpanelName] = $tabpanelName
: $this->tabpanelState[$key] = false, array_keys($this->tabpanelState));
}
}