本文整理匯總了PHP中app\models\Project::upload_projectfile方法的典型用法代碼示例。如果您正苦於以下問題:PHP Project::upload_projectfile方法的具體用法?PHP Project::upload_projectfile怎麽用?PHP Project::upload_projectfile使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類app\models\Project
的用法示例。
在下文中一共展示了Project::upload_projectfile方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: update
/**
* Update the specified resource in storage.
*
* @param int $id
* @return Response
*/
public function update(ProjectRequest $request, $id)
{
$project = Project::find($id);
if ($project) {
$input = $request->except($this->image);
$input['start_date'] = Carbon\Carbon::parse($request->get('start_date'))->format('Y-m-d');
$input['end_date'] = Carbon\Carbon::parse($request->get('end_date'))->format('Y-m-d');
$input[$this->image] = Project::upload_projectfile($request, $this->image, $project->image);
$input['updated_by'] = Auth::user()->id;
$project->fill($input);
$project->save();
Session::flash($this->success, Lang::get('ruban.project.updated'));
$timeline['object_type'] = 1;
$timeline['object_id'] = $id;
$timeline['action'] = 'update';
$timeline['description'] = '<a href="javascript:;">' . $input['name'] . '</a> project has been updated by ' . Auth::user()->first_name . ' ' . Auth::user()->last_name . '.';
Timeline::create($timeline);
return Redirect::route('ruban.projects.index');
} else {
Session::flash($this->danger, Lang::get('ruban.project.notfound'));
return Redirect::route('ruban.projects.index');
}
}