PushNotificationService.php 427 B

1234567891011121314151617
  1. <?php
  2. namespace App\Services;
  3. use App\User;
  4. class PushNotificationService {
  5. public const NOTIFY_TYPES = ['follow', 'like', 'mention', 'comment'];
  6. public const PUSH_GATEWAY_VERSION = '1.0';
  7. public static function check($listId, $memberId) {
  8. $user = User::where('notify_enabled', true)->where('profile_id', $memberId)->first();
  9. return $user ? (bool) $user->{"notify_{$listId}"} : false;
  10. }
  11. }