/**
* Store a newly created resource in storage.
*
* @return Response
*/
public function store()
{
$file = Request::file('xmlfile');
$type = Input::get('type');
$userid = Input::get('userid');
$alpha = Input::get('alpha');
$extension = $file->getClientOriginalExtension();
$oname = $file->getClientOriginalName();
Storage::disk('local')->put("uploads/" . $file->getClientOriginalName(), File::get($file));
$parser = new Parser();
$contents = Storage::get("uploads/" . $file->getClientOriginalName());
$rawxml = $parser->xml($contents);
$importer = new Importer();
if ($type == 'recipes') {
$importer->parseRecipe($rawxml, $userid, $alpha, 1);
}
if ($type == 'blocks') {
$importer->parseBlocks($rawxml, $userid, $alpha, 1);
}
if ($type == 'materials') {
$importer->parseMaterial($rawxml, $userid, $alpha, 1);
}
if ($type == 'items') {
$importer->parseItems($rawxml, $userid, $alpha, 1);
}
//Flash::success('You successfully imported a '.$type.' xml file for 7 Days to Die Alpha '.$alpha.'!');
return view('pages.import');
}