⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.134
Server IP:
68.65.123.197
Server:
Linux premium49.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
Server Software:
LiteSpeed
PHP Version:
8.2.29
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
smarbgfw
/
card.smartech-hub.com
/
app
/
Services
/
View File Name :
PusherBeamsService.php
<?php /* |-------------------------------------------------------------------------- | GoBiz vCard SaaS |-------------------------------------------------------------------------- | Developed by NativeCode © 2021 - https://nativecode.in | All rights reserved | Unauthorized distribution is prohibited |-------------------------------------------------------------------------- */ namespace App\Services; use Pusher\PushNotifications\PushNotifications; class PusherBeamsService { protected $beamsClient; public function __construct() { $instanceId = config('services.beams.instance_id'); $secretKey = config('services.beams.secret_key'); if (empty($instanceId) || empty($secretKey)) { return redirect()->back()->with('failed', trans('Pusher Beams instance ID or secret key is missing.')); } $this->beamsClient = new PushNotifications([ 'instanceId' => $instanceId, 'secretKey' => $secretKey, ]); } /** * Send a notification to all devices subscribed to an interest. * * @param string $interest * @param array $notification * @return mixed */ public function broadcastToInterest(string $interest, array $notification) { // Ensure that the beamsClient is initialized before trying to use it if (!$this->beamsClient) { return redirect()->back()->with('failed', trans('Pusher Beams instance ID or secret key is missing.')); } return $this->beamsClient->publishToInterests( [$interest], [ 'web' => [ 'notification' => $notification, ], ] ); } }