public function destroy(Request $request, Fileentry $fileentry) { $entry = Fileentry::where('id', '=', $fileentry->id)->firstOrFail(); $model = explode(",", $entry->model_id); $file = Storage::disk('local')->delete($entry->filename); $fname = $entry->original_filename; $fileentry->delete(); Log::info('Deleted Files:' . $fname); $request->session()->flash('alert-success', 'File successful deleted!'); if ($request->redirect == 'fileentries') { return redirect('/fileentries?page=' . $request->page); } else { return redirect('/' . $model[0] . '/' . $model[1] . '/update?page=' . $request->page . '&filetab=1'); } }