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