Closed chegmarco1989 closed 4 months ago
Hello.
$user->transactions() // from all wallets
$user->walletTransactions() // from default wallet
$wallet->walletTransactions() // from current wallet
I missed the button and didn't notice it right away.
Apparently, there are no questions. I am closing the issue.
Thanks for anwser.
Even if I add in Top of my Controller and/or in my Model this:
use Bavix\Wallet\Models\Wallet;
I got: Undefined method 'walletTransactions'.
error by implementing it in my following method:
public function getTransactionHistory() {
try {
$user = Auth::user();
if (!$user) {
throw new \Exception("User not authenticated", 401);
}
$transactionHistory = $user->walletTransactions();
return response()->json([
'success' => true,
'message' => 'Transaction history retrieved successfully',
'data' => $transactionHistory
]);
} catch (\Exception $e) {
return response()->json([
'success' => false,
'message' => $e->getMessage(),
'code' => $e->getCode()
]);
}
}
PLEASE HELP ME.
@chegmarco1989 I mistyped the second case. It should be like this:
$user->wallet->walletTransactions() // from default wallet
Thanks for your feedback
Hello.
How to get transaction history (deposit and/or withdrawal) for a personal Laravel user ??? Because I don't see anywhere on the documentation about how to retrieve transaction history (deposit and/or withdrawal) of user's connected.
PLEASE HELP ME.