本文整理汇总了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;
示例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']);
}
示例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');
}
示例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'));
}
示例5: deleteTask
function deleteTask($id)
{
Task::findOrFail($id)->delete();
return Redirect::to('/');
}
示例6: show
/**
* Display the specified resource.
* GET /tasks/{id}
*
* @param int $id
* @return Response
*/
public function show($id)
{
return Task::findOrFail($id);
}
示例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';
}
}
示例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'));
}
示例9: check
public function check($id, Request $request)
{
$task = Task::findOrFail($id);
$task->update($request->all());
return redirect('tasks/index');
}
示例10: doDelete
public function doDelete()
{
$task = Task::findOrFail(Input::get('id'));
$task->delete();
return Redirect::action('TasksController@home');
}
示例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');
}