Пример #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');
 }