1
0
Fork 0
forked from mirror/pixelfed
pixelfed/app/Services/HashtagFollowService.php

22 lines
472 B
PHP
Raw Normal View History

2023-11-11 12:25:23 +00:00
<?php
namespace App\Services;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Redis;
use App\Hashtag;
use App\StatusHashtag;
use App\HashtagFollow;
class HashtagFollowService
{
const FOLLOW_KEY = 'pf:services:hashtag-follows:v1:';
public static function getPidByHid($hid)
{
return Cache::remember(self::FOLLOW_KEY . $hid, 86400, function() use($hid) {
return HashtagFollow::whereHashtagId($hid)->pluck('profile_id')->toArray();
});
}
}