public function deleteTopic() { Input::merge(array_map('trim', Input::all())); $id = (int) Input::get('id'); $topic = Topic::where('parent', $id); if (!$topic->exists()) { Topic::destroy($id); } return 1; }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { Topic::destroy((int) $id); return back(); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { Topic::destroy($id); \Session::flash('success', 'Topic is deleted.'); return redirect('topics'); }
/** * Delete a topic * * @return \Illuminate\Redirect */ public function delete($id) { Topic::destroy($id); return redirect('/'); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy(Request $request) { Post::where('topic_id', '=', $request->topic_id)->delete(); Topic::destroy($request->topic_id); return Redirect::action('TopicController@index'); }