added assets into stream
This commit is contained in:
@@ -24,6 +24,7 @@ use App\Models\TransactionsAdmin;
|
||||
use App\Services\BalanceReportService;
|
||||
use App\Services\ConfigService;
|
||||
use App\Services\WalletBalanceService;
|
||||
use App\Services\WalletBroadcastService;
|
||||
use Hekmatinasser\Verta\Verta;
|
||||
|
||||
|
||||
@@ -154,6 +155,8 @@ class WalletController extends Controller
|
||||
. "\n"
|
||||
. $this->Config('name_fa');
|
||||
$this->Send($customer->mobile, $message);
|
||||
$this->broadcastCustomerWalletAssets($customer);
|
||||
|
||||
return response()->json(true);
|
||||
}
|
||||
public function charge_gold(Request $request)
|
||||
@@ -224,6 +227,8 @@ class WalletController extends Controller
|
||||
. $data['note']
|
||||
. $this->Config('name_fa');
|
||||
$this->Send($customer->mobile, $message);
|
||||
$this->broadcastCustomerWalletAssets($customer);
|
||||
|
||||
return response()->json(true);
|
||||
}
|
||||
|
||||
@@ -367,6 +372,7 @@ class WalletController extends Controller
|
||||
. "\n"
|
||||
. $this->Config('name_fa');
|
||||
$this->Send($customer->mobile, $message);
|
||||
$this->broadcastCustomerWalletAssets($customer);
|
||||
|
||||
return response()->json(true);
|
||||
}
|
||||
@@ -467,6 +473,10 @@ class WalletController extends Controller
|
||||
$transaction->save();
|
||||
$message = 'تراکنش با موفقیت بهروزرسانی شد.';
|
||||
|
||||
$customer = Customer::find($transaction->customer_id);
|
||||
if ($customer) {
|
||||
$this->broadcastCustomerWalletAssets($customer);
|
||||
}
|
||||
|
||||
return response()->json([
|
||||
'message' => $message,
|
||||
@@ -660,4 +670,12 @@ class WalletController extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
private function broadcastCustomerWalletAssets(Customer $customer): void
|
||||
{
|
||||
app(WalletBroadcastService::class)->broadcastForCustomer(
|
||||
(int) $customer->id,
|
||||
(int) $customer->type
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user