/** * Store a newly created resource in storage. * * @return Response */ public function store() { $validation = Validator::make(Input::all(), Term::$rules); if ($validation->fails()) { return Redirect::back()->withInput()->withErrors($validation)->with('error', 'There were validation errors.'); } $vocabulary = Vocabulary::findOrFail(Input::get('vocabulary_id')); $term = \Taxonomy::createTerm($vocabulary->id, Input::get('name')); return Redirect::route($this->route_prefix . 'taxonomy.edit', $vocabulary->id); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { Vocabulary::destroy($id); return Response::make('OK', 200); }