當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。