/** * Update the specified resource in storage. * * @param Project $project * @param 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', 'Tarefa atualizada.'); }
/** * Update the specified resource in storage. * * @param Project $project * @param Task $task * @param \Illuminate\Http\Request $request * @return Response */ public function update(Project $project, Task $task, Request $request) { $this->middleware('auth'); if ($project->ismember(auth()->user()) || access()->hasRole('Administrator')) { $this->validate($request, $this->rules); $input = $this->filter_task_input(); $task->update($input); return Redirect::route('projects.tasks.show', [$project->slug, $task->slug])->with('message', 'Tarefa atualizada.'); } else { return Redirect::route('home')->with('flash_danger', 'Operação não permitida.'); } }