You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pixelfed/app/Services/PushNotificationService.php

20 lines
440 B
PHP

<?php
namespace App\Services;
use App\User;
class PushNotificationService
{
public const NOTIFY_TYPES = ['follow', 'like', 'mention', 'comment', 'share'];
public const PUSH_GATEWAY_VERSION = '1.0';
public static function check($listId, $memberId)
{
$user = User::where('notify_enabled', true)->where('profile_id', $memberId)->first();
return $user ? (bool) $user->{"notify_{$listId}"} : false;
}
}