<?php

namespace App\Livewire\Blesser;

use Livewire\Component;

class Like extends Component
{
    public $product;

    public function toggleLike()
    {
        if ($this->product->isLikedBy(auth()->user())) {
            $this->product->dislike(auth()->user());
        } else {
            $this->product->like(auth()->user());
        }
    }

    public function render()
    {
        return view('livewire.blesser.like');
    }
}
