当前位置: 首页>>代码示例>>PHP>>正文


PHP Task::update方法代码示例

本文整理汇总了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.');
 }
开发者ID:shima-rahman,项目名称:lina,代码行数:13,代码来源:TasksController.php

示例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.');
 }
开发者ID:nowarena,项目名称:homestead,代码行数:15,代码来源:TasksController.php

示例3: markTask

 public function markTask(Request $request, Project $project, Task $task)
 {
     if ($request->ajax()) {
         $input = $request->except('_method');
         $task->update($input);
         return $task;
     }
 }
开发者ID:GeoffSelby,项目名称:Launchpad-Mini,代码行数:8,代码来源:TasksController.php

示例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);
 }
开发者ID:absolux,项目名称:Collabor8-php-api,代码行数:25,代码来源:TasksController.php

示例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.');
 }
开发者ID:jonodonovan,项目名称:jodonovan-com,代码行数:12,代码来源:TasksController.php

示例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.');
 }
开发者ID:TimothyDJones,项目名称:laravel5-test,代码行数:15,代码来源:TasksController.php

示例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');
 }
开发者ID:johnathanmdell,项目名称:phpsouthafrica-2015-laravel-workshop,代码行数:11,代码来源:TasksController.php

示例8: update

 public function update(Request $request, Task $task)
 {
     $task->update($request->all());
     return response()->json(['message' => 'Tarea modificada exitosamente.']);
 }
开发者ID:wyrover,项目名称:todo-api-server,代码行数:5,代码来源:TasksController.php

示例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'));
 }
开发者ID:martinbean,项目名称:react-task-list,代码行数:13,代码来源:TaskController.php

示例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.');
 }
开发者ID:EnigmaDay1,项目名称:projet_laravel,代码行数:16,代码来源:TasksController.php

示例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.');
 }
开发者ID:ikram2001,项目名称:laravel-5.1-basic-app,代码行数:19,代码来源:TasksController.php

示例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'));
 }
开发者ID:jeremyreese,项目名称:quotes,代码行数:10,代码来源:TaskController.php


注:本文中的app\Task::update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。