本文整理汇总了PHP中Payment::findOrFail方法的典型用法代码示例。如果您正苦于以下问题:PHP Payment::findOrFail方法的具体用法?PHP Payment::findOrFail怎么用?PHP Payment::findOrFail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Payment
的用法示例。
在下文中一共展示了Payment::findOrFail方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update
/**
* Update the specified payment in storage.
*
* @param int $id
* @return Response
*/
public function update($id)
{
$payment = Payment::findOrFail($id);
$validator = Validator::make($data = Input::all(), Payment::$rules);
if ($validator->fails()) {
return Redirect::back()->withErrors($validator)->withInput();
}
$payment->update($data);
return Redirect::route('payments.index');
}
示例2: update
/**
* Update the specified payment in storage.
*
* @param int $id
* @return Response
*/
public function update($id)
{
$payment = Payment::findOrFail($id);
$validator = Validator::make($data = Input::all(), Payment::$rules, Payment::$messages);
if ($validator->fails()) {
return Redirect::back()->withErrors($validator)->withInput();
}
$payment->erporder_id = Input::get('order');
$payment->amount_paid = Input::get('amount');
$payment->receipt_no = Input::get('receipt');
$payment->received_by = Input::get('received_by');
$payment->date = date("Y-m-d", strtotime(Input::get('pay_date')));
$payment->update();
return Redirect::route('payments.index')->withFlashMessage('Payment successfully updated!');
}
示例3: show
/**
* Display the specified resource.
* GET /accountreceivables/{id}
*
* @param int $id
* @return Response
*/
public function show($id)
{
$payments = Payment::findOrFail($id);
return View::make('backend.code.payment.show', compact('payments'));
}
示例4: delete
public function delete($id)
{
try {
$payment = Payment::findOrFail($id);
$neighbor_property_id = $payment->neighbor_property_id;
$amount = $payment->amount;
$mes = date("M");
if ($payment->delete(['id'])) {
$payment_states = PaymentStates::where('neighbor_property_id', '=', $neighbor_property_id)->first();
$payment_states->accumulated = $payment_states->accumulated - $amount;
$payment_states->{$mes} = $payment_states->{$mes} - $amount;
$payment_states->update(['id']);
return Redirect::back()->with('error', false)->with('msg', 'Pago removido exitosamente.')->with('class', 'warning');
} else {
echo $exc->getMessage() . " " . $exc->getLine();
return Redirect::back()->with('error', true)->with('msg', '¡Algo salió mal! Contacte con administrador')->with('class', 'danger');
}
} catch (Exception $exc) {
echo $exc->getMessage() . " " . $exc->getLine();
return Redirect::back()->with('error', true)->with('msg', '¡Algo salió mal! Contacte con administrador')->with('class', 'danger');
}
}
示例5: notvalidasi
public function notvalidasi($id)
{
$payment = Payment::findOrFail($id);
$data['verifikasi'] = 0;
$payment->update($data);
return Redirect::to('admin/valid' . '?statvalid=' . Session::get('statusvalid'))->with("successMessage", "Berhasil membatalkan validasi");
}