public function selectFromTemplate($temp, $variant) { $variables = DB::table('variables')->where('t_id', '=', $temp)->get(); foreach ($variables as $var) { $varvar = new Variables_variant(); $varvar->variable_id = $var->id; $varvar->type_id = $var->type; $varvar->variant_id = $variant; $varvar->save(); $id = $varvar->id; $varvartexts = new Varvar_text(); $varvartexts->varvar_id = $id; $varvartexts->type_id = $var->type; $varvartexts->save(); // DB::table('varvar_texts')->insert(array('varvar_id' => $id, 'type_id'=>$var->type)); } //print_r($variables); return Variant::formtype($variant); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $this->varvar_text->find($id)->delete(); return Redirect::route('varvar_texts.index'); }