本文整理汇总了PHP中app\Task::update方法的典型用法代码示例。如果您正苦于以下问题:PHP Task::update方法的具体用法?PHP Task::update怎么用?PHP Task::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Task
的用法示例。
在下文中一共展示了Task::update方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update
/**
* Update the specified resource in storage.
*
* @param int $id
* @return Response
*/
public function update(Project $project, Task $task)
{
// return view('tasks/index',compact('project'));
$input = array_except(Input::all(), '_method');
$task->update($input);
return Redirect::route('projects.tasks.show', [$project->slug, $task->slug])->with('message', 'Task updated.');
}
示例2: update
/**
* Update the specified resource in storage.
*
* @param \App\Project $project
* @param \App\Task $task
* @param \Illuminate\Http\Request $request
* @return Response
*/
public function update(Project $project, Task $task, Request $request)
{
$this->validate($request, $this->rules);
$input = array_except(Input::all(), '_method');
$task->update($input);
return Redirect::route('projects.tasks.show', [$project->slug, $task->slug])->with('message', 'Task updated.');
}
示例3: markTask
public function markTask(Request $request, Project $project, Task $task)
{
if ($request->ajax()) {
$input = $request->except('_method');
$task->update($input);
return $task;
}
}
示例4: update
/**
* Update the specified task
*
* @param Request $request
* @param Project $project
* @param Task $task
* @return Task
*/
public function update(Request $request, Project $project, Task $task)
{
if (empty($user_id = $request->input('user_id'))) {
$task->assignee()->dissociate();
} else {
$user = \App\User::findOrFail($user_id);
$task->assignee()->associate($user);
}
if (empty($label_id = $request->input('label_id'))) {
$task->label()->dissociate();
} else {
$label = \App\ProjectLabel::findOrFail($label_id);
$task->label()->associate($label);
}
$task->update($request->all());
return $this->show($project, $task);
}
示例5: update
/**
* Update the specified resource in storage.
*
* @param int $id
* @return Response
*/
public function update(Project $project, Task $task)
{
$input = array_except(Input::all(), '_method');
$task->update($input);
return Redirect::route('projects.open', [$project->slug])->with('message', 'Task updated.');
}
示例6: update
/**
* Update the specified resource in storage.
*
* @param \App\Project $project
* @param \App\Task $task
* @return Response
*/
public function update(Project $project, Task $task, Request $request)
{
// Validate the request before continuing...
$this->validate($request, $this->rules);
$input = array_except(Input::all(), array('_method', 'slug'));
$task->update($input);
return Redirect::route('projects.tasks.show', array($project->slug, $task->slug))->with('message', 'Task updated.');
}
示例7: mark
/**
* Marks the specific task as either completed or not.
*
* @param Task $task
* @return Response
*/
public function mark(Task $task)
{
$task->update(['completed' => $task->completed === 0 ? 1 : 0]);
return redirect()->route('tasks.index');
}
示例8: update
public function update(Request $request, Task $task)
{
$task->update($request->all());
return response()->json(['message' => 'Tarea modificada exitosamente.']);
}
示例9: update
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param \App\TaskList $task_list
* @param \App\Task $task
* @return \Illuminate\Http\Response
*/
public function update(Request $request, TaskList $task_list, Task $task)
{
$task->update($request->all());
return response()->json(compact('task'));
}
示例10: update
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Project $project, Task $task, Request $request)
{
$this->validate($request, $this->rules);
//vérifie les règles avant de modifier la tâche
$input = array_except(Input::all(), '_method');
$input['slug'] = str_replace(' ', '_', strtolower(Input::get('name')));
$task->update($input);
return Redirect::route('projects.show', $project->slug)->with('message', 'Tâche mise à jour.');
}
示例11: update
/**
* Update the specified resource in storage.
*
* @param \App\Project $project
* @param \App\Task $task
* @return Response
*/
public function update(Project $project, Task $task, Request $request)
{
$validator = Validator::make($request->all(), ['name' => 'required|min:3|max:255', 'slug' => 'required|min:3|max:255', 'description' => 'max:1024']);
if ($validator->fails()) {
return redirect()->back()->withInput()->withErrors($validator);
}
//$this->validate($request, $this->rules);
//
$input = array_except(Input::all(), '_method');
$task->update($input);
return Redirect::route('projects.tasks.show', [$project->slug, $task->slug])->with('message', 'Success: Your Task updated.');
}
示例12: update
/**
* @param Task $task
* @param Request $request
* @return \Illuminate\Http\RedirectResponse
*/
public function update(Task $task, Request $request)
{
$request->merge(['user_id' => Sentinel::getUser()->id]);
$task->update($request->except('_method', '_token'));
}