当前位置: 首页>>代码示例>>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;未经允许,请勿转载。