Changeset View
Changeset View
Standalone View
Standalone View
src/app/Http/Controllers/API/V4/WalletsController.php
Show First 20 Lines • Show All 155 Lines • ▼ Show 20 Lines | public function transactions($id) | ||||
$page = intval(request()->input('page')) ?: 1; | $page = intval(request()->input('page')) ?: 1; | ||||
$hasMore = false; | $hasMore = false; | ||||
$isAdmin = $this instanceof Admin\WalletsController; | $isAdmin = $this instanceof Admin\WalletsController; | ||||
if ($transaction = request()->input('transaction')) { | if ($transaction = request()->input('transaction')) { | ||||
// Get sub-transactions for the specified transaction ID, first | // Get sub-transactions for the specified transaction ID, first | ||||
// check access rights to the transaction's wallet | // check access rights to the transaction's wallet | ||||
/** @var ?\App\Transaction $transaction */ | |||||
$transaction = $wallet->transactions()->where('id', $transaction)->first(); | $transaction = $wallet->transactions()->where('id', $transaction)->first(); | ||||
if (!$transaction) { | if (!$transaction) { | ||||
return $this->errorResponse(404); | return $this->errorResponse(404); | ||||
} | } | ||||
$result = Transaction::where('transaction_id', $transaction->id)->get(); | $result = Transaction::where('transaction_id', $transaction->id)->get(); | ||||
} else { | } else { | ||||
▲ Show 20 Lines • Show All 102 Lines • Show Last 20 Lines |