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