src/Services/LikeableService.php
public function removeLikeCountersOfType($likeableType, $type = null)
    {
        if (class_exists($likeableType)) {
            /** @var \Cog\Likeable\Contracts\Likeable $likeable */
            $likeable = new $likeableType;
            $likeableType = $likeable->getMorphClass();
        }

        /** @var \Illuminate\Database\Eloquent\Builder $counters */
        $counters = app(LikeCounterContract::class)->where('likeable_type', $likeableType);
        if (!is_null($type)) {
            $counters->where('type_id', $this->getLikeTypeId($type));
        }
        $counters->delete();
    }
public function removeLikeCountersOfType($likeableType, $type = null)
    {
        if (class_exists($likeableType)) {
            /** @var \Cog\Likeable\Contracts\Likeable $likeable */
            $likeable = new $likeableType;
            $likeableType = $likeable->getMorphClass();
        }

        /** @var \Illuminate\Database\Eloquent\Builder $counters */
        $counters = app(LikeCounterContract::class)->where('likeable_type', $likeableType);
        if (!is_null($type)) {
            $counters->where('type_id', $this->getLikeTypeId($type));
        }
        $counters->delete();
    }
public function removeLikeCountersOfType ( $ likeableType , $ type = null ) { if ( class_exists ( $ likeableType ) ) { /** @var \Cog\Likeable\Contracts\Likeable $likeable */ $ likeable = new $ likeableType ; $ likeableType = $ likeable -> getMorphClass ( ) ; } /** @var \Illuminate\Database\Eloquent\Builder $counters */ $ counters = app ( LikeCounterContract :: class ) -> where ( 'likeable_type' , $ likeableType ) ; if ( ! is_null ( $ type ) ) { $ counters -> where ( 'type_id' , $ this -> getLikeTypeId ( $ type ) ) ; } $ counters -> delete ( ) ; }
Remove like counters by likeable type.

@param string $likeableType
@param string|null $type
@return void

@throws \Cog\Likeable\Exceptions\LikeTypeInvalidException
Remove like counters by likeable type .