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


PHP Project::FindORFail方法代碼示例

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


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

示例1: updatepartner

 public function updatepartner(CardPartnerRequest $request, $id)
 {
     $input = $request->all();
     $card = Card::FindORFail($id);
     $project = Project::FindORFail($card->project_id);
     $input['card_id'] = $id;
     PartnerCards::where('card_id', $id)->where('partner_id', $request->get('partner_id'))->delete();
     PartnerCards::create($input);
     $user = User::find($input['partner_id']);
     $client = User::find(2);
     $data['email'] = $user->email;
     $data['name'] = $user->first_name . ' ' . $user->last_name;
     $data['content'] = $card->name . ' of the ' . $project->name . ' project has been assigned to you.';
     Card::Mailing($data);
     $data1['email'] = $client->email;
     $data1['name'] = $client->first_name . ' ' . $client->last_name;
     $data1['content'] = $card->name . ' of the ' . $project->name . ' project has been assigned to ' . $data['name'] . ' Partner.';
     Card::Mailing($data1);
     $timeline['object_type'] = 3;
     $timeline['object_id'] = $id;
     $timeline['action'] = 'assign';
     $timeline['description'] = '<a href="javascript:;">' . $card->name . '</a> card has been assigned to ' . $user->first_name . ' ' . $user->last_name . ' by ' . Auth::user()->first_name . ' ' . Auth::user()->last_name . '.';
     Timeline::create($timeline);
     Session::flash('success', Lang::get('ruban.partner.assigned'));
     return Redirect::route('ruban.cards.index');
 }
開發者ID:mahitiinfo,項目名稱:rubanbridge,代碼行數:26,代碼來源:CardController.php


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