本文整理汇总了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');
}