/** * Remove the specified template from storage. * * @param int $id * @return Response */ public function destroy($id) { Template::destroy($id); return Redirect::route('templates.index'); }
/** * Remove the specified template from storage. * * @param int $id * @return Response */ public function destroy($id) { $template = Template::findOrFail($id); $file = $template->file; $paths = public_path() . '/uploads/templates/' . $file; File::delete($paths); Template::destroy($id); return Redirect::route('admin.template.index')->with("successMessage", "Template berhasil dihapus. "); }