added assets into stream

This commit is contained in:
2026-06-27 15:51:44 +03:30
parent a0b3d8d3f5
commit 7b05db0ff0
6 changed files with 170 additions and 16 deletions
@@ -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
);
}
}