forked from eatvio/eatvio-infra
36 lines
677 B
PHP
Executable File
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,
|
|
]
|
|
);
|
|
}
|
|
}
|