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


PHP Task::findOrFail方法代码示例

本文整理汇总了PHP中Task::findOrFail方法的典型用法代码示例。如果您正苦于以下问题:PHP Task::findOrFail方法的具体用法?PHP Task::findOrFail怎么用?PHP Task::findOrFail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Task的用法示例。


在下文中一共展示了Task::findOrFail方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: function

            case "haciendo":
                $task->scrumid = 2;
                break;
            case "hecho":
                $task->scrumid = 3;
                break;
        }
        $task->save();
        return Response::json(array('succes' => '1'));
    }
});
//editar tarea
Route::post('tareas/editTask', function () {
    if (Request::ajax()) {
        $id = Input::get("id");
        $task = Task::findOrFail($id);
        $task->name = Input::get("name");
        $task->summary = Input::get("summary");
        $task->points = Input::get("points");
        $task->timeEstimated = Input::get("timeEstimated");
        if (Input::get("canRegisterSpent") == 0) {
            $timeReal = $task->timeReal;
            $task->timeReal = $timeReal + Input::get("timeReal");
            $task->timeRemaining = $task->timeEstimated - $task->timeReal;
        }
        $task->userid = Input::get("selAssignee");
        $task->save();
        $final = "no";
        $issue = Issue::findOrFail($task->issueid);
        $iteration = $issue->iterations;
        //$iteration = $issue->iteration;
开发者ID:josimarjimenez,项目名称:architects,代码行数:31,代码来源:routes.php

示例2: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($task_id)
 {
     $task = Task::findOrFail($task_id);
     $task->delete();
     return Redirect::to(route('tasks.index'))->with('message', ['content' => 'Taak met succes verwijderd!', 'class' => 'success']);
 }
开发者ID:l0ngestever,项目名称:logboek,代码行数:12,代码来源:TasksController.php

示例3: showRemaining

 public function showRemaining($id)
 {
     $task = Task::findOrFail($id);
     $this->layout->content = View::make('layouts.task.remainingForm')->with('organization', app('organization'))->with('type', 'new');
 }
开发者ID:josimarjimenez,项目名称:architects,代码行数:5,代码来源:TaskController.php

示例4: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     return View::make('tasks.create')->with('task', Task::findOrFail($id))->with('title', 'Edit Task')->with('method', 'PUT')->with('url', 'tasks/' . $id)->with('priorities', Priority::lists('priority_name', 'id'))->with('statuses', Status::lists('status_name', 'id'));
 }
开发者ID:x4rMa,项目名称:Vehicle-Inspection-System,代码行数:10,代码来源:TaskController.php

示例5: deleteTask

 function deleteTask($id)
 {
     Task::findOrFail($id)->delete();
     return Redirect::to('/');
 }
开发者ID:agrawalakhil,项目名称:laravel-authenticated-tasklist,代码行数:5,代码来源:HomeController.php

示例6: show

 /**
  * Display the specified resource.
  * GET /tasks/{id}
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     return Task::findOrFail($id);
 }
开发者ID:anildukkipatty,项目名称:maurice-tool-laravel,代码行数:11,代码来源:TasksController.php

示例7: updateStatus

 public function updateStatus($data, $userId)
 {
     try {
         $task = \Task::findOrFail($data['id']);
         if ($data['status'] == 'completed') {
             $task->status = 'completed';
             $task->completed_on = date('Y-m-d H:i:s');
             $task->updated_by = $userId;
             $task->save();
         } elseif ($data['status'] == 'active') {
             $task->status = 'active';
             $task->completed_on = null;
             $task->updated_by = $userId;
             $task->save();
         }
         return 'success';
     } catch (Exception $e) {
         \Log::error('Somthing Went Wrong in Task Repository - updateStatus():' . $e->getMessage());
         return 'error';
     }
 }
开发者ID:ymnl007,项目名称:92five,代码行数:21,代码来源:TaskRepository.php

示例8: show

 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     $task = $this->task->findOrFail($id);
     return View::make('tasks.show', compact('task'));
 }
开发者ID:aletuan,项目名称:forge-demo,代码行数:11,代码来源:TasksController.php

示例9: check

 public function check($id, Request $request)
 {
     $task = Task::findOrFail($id);
     $task->update($request->all());
     return redirect('tasks/index');
 }
开发者ID:dicrotect,项目名称:todo_list,代码行数:6,代码来源:tasksController.php

示例10: doDelete

 public function doDelete()
 {
     $task = Task::findOrFail(Input::get('id'));
     $task->delete();
     return Redirect::action('TasksController@home');
 }
开发者ID:christean,项目名称:todolist,代码行数:6,代码来源:TasksController.php

示例11: show

 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($id)
 {
     $shop = Task::findOrFail($id);
     return view('admin.shopinfo.shopinfo');
 }
开发者ID:JackFrankWen,项目名称:Laravel,代码行数:11,代码来源:HomeController.php


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