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