예제 #1
0
 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;
 }
예제 #2
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int $id
  * @return Response
  */
 public function destroy($id)
 {
     Topic::destroy((int) $id);
     return back();
 }
예제 #3
0
 /**
  * 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');
 }
예제 #4
0
 /**
  * Delete a topic
  *
  * @return \Illuminate\Redirect
  */
 public function delete($id)
 {
     Topic::destroy($id);
     return redirect('/');
 }
예제 #5
0
 /**
  * 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');
 }