public function getDelete($id) { if (Request::ajax()) { $todo = Todo::whereId($id)->first(); $todo->delete(); return 'OK'; } }