src/Console/LikeableRecountCommand.php
protected function recountLikesOfModelType($modelType)
    {
        $modelType = $this->normalizeModelType($modelType);

        $counters = $this->service->fetchLikesCounters($modelType, $this->likeType);

        $this->service->removeLikeCountersOfType($modelType, $this->likeType);

        DB::table(app(LikeCounterContract::class)->getTable())->insert($counters);

        $this->info('All [' . $modelType . '] records likes has been recounted.');
    }
protected function recountLikesOfModelType($modelType)
    {
        $modelType = $this->normalizeModelType($modelType);

        $counters = $this->service->fetchLikesCounters($modelType, $this->likeType);

        $this->service->removeLikeCountersOfType($modelType, $this->likeType);

        DB::table(app(LikeCounterContract::class)->getTable())->insert($counters);

        $this->info('All [' . $modelType . '] records likes has been recounted.');
    }
protected function recountLikesOfModelType ( $ modelType ) { $ modelType = $ this -> normalizeModelType ( $ modelType ) ; $ counters = $ this -> service -> fetchLikesCounters ( $ modelType , $ this -> likeType ) ; $ this -> service -> removeLikeCountersOfType ( $ modelType , $ this -> likeType ) ; DB :: table ( app ( LikeCounterContract :: class ) -> getTable ( ) ) -> insert ( $ counters ) ; $ this -> info ( 'All [' . $ modelType . '] records likes has been recounted.' ) ; }
Recount likes of model type.

@param string $modelType
@return void

@throws \Cog\Likeable\Exceptions\ModelInvalidException
Recount likes of model type .