예제 #1
0
 public function delete()
 {
     TodoItem::where('todo_list_id', $this->id)->delete();
     parent::delete();
 }
예제 #2
0
 /**
  * Complete the item by adding a completed date
  *
  * @param  int  $list_id
  * @param  int  $item_id
  * @return Response
  */
 public function complete($list_id, $item_id)
 {
     $item = TodoItem::findOrFail($item_id);
     $item->completed_on = date('Y-m-d H:i:s');
     $item->update();
     return Redirect::route('todos.show', $list_id)->withMessage("Item completed");
 }
 /**
  * Complete the item by adding a completed date.
  *
  * @param  int  $list_id
  * @param  int  $item_id
  * @return Response
  */
 public function complete($list_id, $item_id)
 {
     $item = \App\TodoItem::findOrFail($item_id);
     $item->complete_on = date('Y-m-d H:i:s');
     $item->update();
     return redirect()->route('todos.show', $list_id)->withMessage('Item completed.');
 }