Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

pixelfed/pixelfed

6813 stars
1 code files
View pixelfed/pixelfed on GitHub

app/Services/LikeService.php

Open in GitHub
use App\Util\ActivityPub\Helpers;
use Illuminate\Support\Facades\Cache;
 
class LikeService {
 
const CACHE_KEY = 'pf:services:likes:ids:';
 
public static function add($profileId, $statusId)
{
$key = self::CACHE_KEY . $profileId . ':' . $statusId;
$ttl = now()->addHours(2);
return Cache::put($key, true, $ttl);
}
 
public static function remove($profileId, $statusId)
{
$key = self::CACHE_KEY . $profileId . ':' . $statusId;
$ttl = now()->addHours(2);
return Cache::put($key, false, $ttl);
}
//
}

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.