Files
eatvio-infra/app/Livewire/Plan/LikeCount.php
2024-01-09 13:25:22 +03:00

36 lines
677 B
PHP
Executable File

<?php
namespace App\Livewire\Plan;
use App\Models\Plan;
use Livewire\Component;
use Illuminate\View\View;
class LikeCount extends Component
{
public Plan $plan;
protected function getListeners(): array
{
return ['liked-details' => '$refresh', 'liked-footer' => '$refresh'];
}
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,
]
);
}
}