/** * Store a newly created resource in storage. * * @param Slicer $slicer * @param SlicerSettingRequest|\Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Slicer $slicer, SlicerSettingRequest $request) { $file = Request::file('config'); $extension = $file->getClientOriginalExtension(); $new_filename = $file->getFilename() . '.' . $extension; Storage::disk('local')->put($new_filename, File::get($file)); $setting = new SlicerSetting($request->all()); $setting->file_name = $file->getFilename(); $setting->file_extension = "." . $extension; $slicer->Setting()->save($setting); foreach (PrintJob::All() as $job) { $this->dispatch(new ProcessSTL($job, $setting)); } return redirect('slicersetting'); }
/** * Remove the specified resource from storage. * * @param Slicer $slicer * @return \Illuminate\Http\Response * @internal param int $id */ public function destroy(Slicer $slicer) { $slicer->delete(); return redirect('slicer'); }