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