src/Services/LikeableService.php
public function removeLikeFrom(LikeableContract $likeable, $type, $userId)
    {
        $like = $likeable->likesAndDislikes()->where([
            'user_id' => $this->getLikerUserId($userId),
            'type_id' => $this->getLikeTypeId($type),
        ])->first();

        if (!$like) {
            return;
        }

        $like->delete();
    }
public function removeLikeFrom(LikeableContract $likeable, $type, $userId)
    {
        $like = $likeable->likesAndDislikes()->where([
            'user_id' => $this->getLikerUserId($userId),
            'type_id' => $this->getLikeTypeId($type),
        ])->first();

        if (!$like) {
            return;
        }

        $like->delete();
    }
public function removeLikeFrom ( LikeableContract $ likeable , $ type , $ userId ) { $ like = $ likeable -> likesAndDislikes ( ) -> where ( [ 'user_id' => $ this -> getLikerUserId ( $ userId ) , 'type_id' => $ this -> getLikeTypeId ( $ type ) , ] ) -> first ( ) ; if ( ! $ like ) { return ; } $ like -> delete ( ) ; }
Remove a like to likeable model by user.

@param \Cog\Likeable\Contracts\Likeable $likeable
@param string $type
@param int|null $userId
@return void

@throws \Cog\Likeable\Exceptions\LikerNotDefinedException
@throws \Cog\Likeable\Exceptions\LikeTypeInvalidException
Remove a like to likeable model by user .