forked from eatvio/eatvio-infra
32 lines
594 B
PHP
Executable File
32 lines
594 B
PHP
Executable File
<?php
|
|
|
|
namespace App\Livewire\Plan;
|
|
|
|
use App\Models\Plan;
|
|
use Livewire\Component;
|
|
|
|
class LikeCount extends Component
|
|
{
|
|
public Plan $plan;
|
|
|
|
protected $listeners = ['liked-details' => '$refresh', 'liked-footer' => '$refresh'];
|
|
|
|
public function mount(Plan $plan)
|
|
{
|
|
$this->plan = $plan;
|
|
}
|
|
|
|
public function render()
|
|
{
|
|
$this->dispatch('liked-details');
|
|
$this->dispatch('liked-footer');
|
|
|
|
return view(
|
|
'livewire.plan.like-count',
|
|
[
|
|
'count' => $this->plan->likes_count,
|
|
]
|
|
);
|
|
}
|
|
}
|