Update source into github

This commit is contained in:
pbao9
2025-07-24 16:18:27 +07:00
parent 41419358dd
commit 69851ac7bc
2642 changed files with 284095 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
<?php
namespace App\Http\Services;
use GuzzleHttp\Exception\GuzzleException;
use Pusher\ApiErrorException;
use Pusher\Pusher;
use Pusher\PusherException;
class PusherNotification
{
//
/**
* @throws PusherException
* @throws ApiErrorException
* @throws GuzzleException
* @throws \JsonException
*/
public function Notification($message = '', $error = true): void
{
//Pusher
$pusher = new Pusher(
env('PUSHER_APP_KEY'),
env('PUSHER_APP_SECRET'),
env('PUSHER_APP_ID'),
[
'cluster' => env('PUSHER_APP_CLUSTER')
]
);
$pusher->trigger('Notification',
'Notification-Event',
json_encode([
'error' => $error,
'message' => $message
], JSON_THROW_ON_ERROR));
}
}