|
Server : Apache/2.4.41 (Ubuntu) System : Linux vmi1525618.contaboserver.net 5.4.0-105-generic #119-Ubuntu SMP Mon Mar 7 18:49:24 UTC 2022 x86_64 User : www-data ( 33) PHP Version : 8.2.12 Disable Function : NONE Directory : /var/www/globalaudiovideo/shop.globalaudiovideo.co.in/app/Services/ |
Upload File : |
<?php
namespace App\Services;
use App\Traits\PushNotificationTrait;
class CustomerWalletService
{
use PushNotificationTrait;
public function sendPushNotificationMessage(object $request, object $customer): bool
{
$customerFCMToken = $customer?->cm_firebase_token;
if (!empty($customerFCMToken)) {
$lang = $customer?->app_language ?? getDefaultLanguage();
$value = $this->pushNotificationMessage('fund_added_by_admin_message', 'customer', $lang);
if ($value) {
$data = [
'title' => setCurrencySymbol(amount: currencyConverter(amount: $request['amount']), currencyCode: getCurrencyCode(type: 'default')) . ' ' . translate('_fund_added'),
'description' => $value,
'image' => '',
'type' => 'wallet'
];
$this->sendPushNotificationToDevice($customerFCMToken, $data);
}
}
return true;
}
}