/** * Handle a POST request to remind a user of their password. * * @return Response */ public function postRemind() { switch ($response = Password::remind(Input::only('username'))) { case Password::INVALID_USER: Flash::error(Lang::get($response)); return Redirect::back(); case Password::REMINDER_SENT: Flash::success(Lang::get($response)); return Redirect::back(); } }
public function postEditBid() { $data = \Input::all(); $lender = \Auth::user()->getLender(); $loan = LoanQuery::create()->filterById($data['loanId'])->findOne(); $totalLoanAmount = $loan->getAmount(); $amount = Money::valueOf($data['amount'], Currency::valueOf('USD')); $oldBid = BidQuery::create()->filterByLender($lender)->filterByLoan($loan)->findOne(); if ($oldBid->getBidAmount()->compare($amount) != -1) { \Flash::error(\Lang::get('Loan.edit-bid.amount')); return Redirect::back()->withInput(); } if ($totalLoanAmount->getAmount() <= $data['amount']) { \Flash::error(\Lang::get('Loan.edit-bid.interest-rate')); return Redirect::back()->withInput(); } if ($data['interestRate'] <= $oldBid->getInterestRate()) { \Flash::error(\Lang::get('Loan.edit-bid.bid-amount-exceded')); return Redirect::back()->withInput(); } $bid = BidQuery::create()->filterByLoan($loan)->filterByLender($lender)->findOne(); $this->loanService->editBid($bid, $data); Flash::success(\Lang::get('Loan.edit-bid.success') . $data['amount']); return Redirect::route('loan:index', $data['loanId']); }
public function postDeleteUpload() { $comment = CommentQuery::create()->filterById(\Input::get('comment_id'))->findOne(); $upload = \Zidisha\Upload\UploadQuery::create()->filterById(\Input::get('upload_id'))->findOne(); $user = \Auth::user(); if (!$comment || !$upload || $comment->getUserId() != $user->getId()) { App::abort(404, 'Bad Request'); } $this->commentService->deleteUpload($comment, $upload); Flash::success(\Lang::get('comments.flash.file-deleted')); return Redirect::back(); }