public function update($id, TodosRequest $request)
 {
     Todos::findorFail($id)->update($request->all());
     return redirect('todos');
 }
Beispiel #2
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Todo $todos, TodosRequest $request)
 {
     $todos = auth()->user()->todos()->create($request->all());
     return redirect()->route('admin.todos.index')->withSuccess("La tarea [{$todos->name}] ha sido guardada satisfactoriamente...");
 }
 /**
  * Save a new task
  *
  * @param TodosRequest $request
  * @return mixed
  */
 private function createTask(TodosRequest $request)
 {
     $task = Auth::user()->todos()->create($request->all());
     $this->syncTags($task, $request->input('tag_list'));
     return $task;
 }