當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Organization::findOrFail方法代碼示例

本文整理匯總了PHP中Organization::findOrFail方法的典型用法代碼示例。如果您正苦於以下問題:PHP Organization::findOrFail方法的具體用法?PHP Organization::findOrFail怎麽用?PHP Organization::findOrFail使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Organization的用法示例。


在下文中一共展示了Organization::findOrFail方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: update

 /**
  * Update the specified organization in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     $organization = Organization::findOrFail($id);
     $validator = Validator::make($data = Input::all(), Organization::$rules);
     if ($validator->fails()) {
         return Redirect::back()->withErrors($validator)->withInput();
     }
     $organization->update($data);
     return Redirect::route('organizations.index');
 }
開發者ID:waldenylson,項目名稱:alfredapp,代碼行數:16,代碼來源:OrganizationsController.php

示例2: statement

 public function statement($id)
 {
     $account = Savingaccount::findOrFail($id);
     $transactions = $account->transactions;
     $credit = DB::table('savingtransactions')->where('savingaccount_id', '=', $account->id)->where('type', '=', 'credit')->sum('amount');
     $debit = DB::table('savingtransactions')->where('savingaccount_id', '=', $account->id)->where('type', '=', 'debit')->sum('amount');
     $balance = $credit - $debit;
     $organization = Organization::findOrFail(1);
     $pdf = PDF::loadView('pdf.statement', compact('transactions', 'organization', 'account', 'balance'))->setPaper('a4')->setOrientation('potrait');
     return $pdf->stream('statement.pdf');
 }
開發者ID:kenkode,項目名稱:xaraerp,代碼行數:11,代碼來源:SavingtransactionsController.php

示例3: receipt

 public function receipt($id)
 {
     $transaction = Loantransaction::findOrFail($id);
     $organization = Organization::findOrFail(1);
     $pdf = PDF::loadView('pdf.loanreports.receipt', compact('transaction', 'organization'))->setPaper('a5')->setOrientation('potrait');
     return $pdf->stream('receipt.pdf');
 }
開發者ID:kenkode,項目名稱:xaraerp,代碼行數:7,代碼來源:LoantransactionsController.php

示例4: logo

 public function logo($id)
 {
     if (Input::hasFile('logo')) {
         $destination = public_path() . '/uploads/logo/';
         $filename = str_random(12);
         $ext = Input::file('logo')->getClientOriginalExtension();
         $photo = $filename . '.' . $ext;
         Input::file('logo')->move($destination, $photo);
         $organization = Organization::findOrFail($id);
         $organization->logo = $photo;
         $organization->update();
     }
     //return Redirect::to('organizations');
 }
開發者ID:kenkode,項目名稱:xaraerp,代碼行數:14,代碼來源:OrganizationsController.php


注:本文中的Organization::findOrFail方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。