restore composer.json, add mysqli extension

This commit is contained in:
2026-04-15 17:02:52 +05:00
commit 77cf56a348
4317 changed files with 1397107 additions and 0 deletions

52
app/Api/Firebase.php Executable file
View File

@@ -0,0 +1,52 @@
<?php
namespace App\Api;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\ClientException;
class Firebase
{
protected $client;
protected $token = 'token';
public function __construct()
{
$this->client = new Client();
}
/**
* @param $notification
* @param $tokens
* @return \Exception|ClientException|\Psr\Http\Message\StreamInterface
*/
public function send_notification($notification, $tokens)
{
$url = 'https://fcm.googleapis.com/fcm/send';
$fields = [
// "priority"=>"high",
"registration_ids" => $tokens,
'notification' => $notification,
'data' => $notification,
//'content-available' => true,
'priority' => 'high'
];
$headers = [
"Authorization" => "key={$this->token}",
'Content-Type' => 'application/json',
];
try {
$request = $this->client->post($url, [
'headers' => $headers,
'json' => $fields,
]);
$response = $request->getBody();
return $response;
} catch (ClientException $exception) {
return $exception;
}
}
}