Ejemplo n.º 1
0
 /**
  * Destory a resource.
  *
  * @return Response
  */
 public function deleteDestroy($id)
 {
     $vocabulary = $this->vocabulary->find($id);
     $terms = $vocabulary->terms->lists('id')->toArray();
     TermRelation::whereIn('term_id', $terms)->delete();
     Term::destroy($terms);
     $this->vocabulary->destroy($id);
     return Redirect::back();
 }
Ejemplo n.º 2
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function deleteDestroy($id)
 {
     // Delete children if any exist
     Term::whereParent($id)->delete();
     // Delete Term
     Term::destroy($id);
     return Redirect::back();
 }