Files
eatvio-infra/app/Livewire/Plan/LikeCount.php
2024-01-09 15:33:59 +03:00

36 lines
677 B
PHP
Executable File

<?php
namespace App\Livewire\Plan;
use App\Models\Plan;
use Illuminate\View\View;
use Livewire\Component;
class LikeCount extends Component
{
public Plan $plan;
public function mount(Plan $plan): void
{
$this->plan = $plan;
}
public function render(): View
{
$this->dispatch('liked-details');
$this->dispatch('liked-footer');
return view(
'livewire.plan.like-count',
[
'count' => $this->plan->likes_count,
]
);
}
protected function getListeners(): array
{
return ['liked-details' => '$refresh', 'liked-footer' => '$refresh'];
}
}