Changeset View
Changeset View
Standalone View
Standalone View
src/app/Http/Controllers/API/V4/WalletsController.php
Show First 20 Lines • Show All 120 Lines • ▼ Show 20 Lines | class WalletsController extends Controller | ||||
* | * | ||||
* @return \Illuminate\Http\Response | * @return \Illuminate\Http\Response | ||||
*/ | */ | ||||
public function receiptDownload($id, $receipt) | public function receiptDownload($id, $receipt) | ||||
{ | { | ||||
$wallet = Wallet::find($id); | $wallet = Wallet::find($id); | ||||
if (empty($wallet) || !$this->checkTenant($wallet->owner)) { | if (empty($wallet) || !$this->checkTenant($wallet->owner)) { | ||||
return $this->errorResponse(404); | abort(404); | ||||
} | } | ||||
// Only owner (or admin) has access to the wallet | // Only owner (or admin) has access to the wallet | ||||
if (!$this->guard()->user()->canRead($wallet)) { | if (!$this->guard()->user()->canRead($wallet)) { | ||||
abort(403); | abort(403); | ||||
} | } | ||||
list ($year, $month) = explode('-', $receipt); | list ($year, $month) = explode('-', $receipt); | ||||
▲ Show 20 Lines • Show All 204 Lines • Show Last 20 Lines |