当前位置: 首页>>代码示例>>PHP>>正文


PHP Payment::findOrFail方法代码示例

本文整理汇总了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');
 }
开发者ID:emanmks,项目名称:oneschool,代码行数:16,代码来源:PaymentsController.php

示例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!');
 }
开发者ID:kenkode,项目名称:xaraerp,代码行数:21,代码来源:PaymentsController.php

示例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'));
 }
开发者ID:jeremiteki,项目名称:mteja,代码行数:12,代码来源:PaymentController.php

示例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');
     }
 }
开发者ID:prianticonsulting,项目名称:Habitaria,代码行数:22,代码来源:PaymentsController.php

示例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");
 }
开发者ID:inseo201,项目名称:atletik4,代码行数:7,代码来源:ValidController.php


注:本文中的Payment::findOrFail方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。