Merge pull request #786 from imanghafoori1/flatten_code

Flatten code
This commit is contained in:
Jitendra Singh 2019-04-03 14:49:06 +05:30 committed by GitHub
commit d0e5e6a88f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 8 deletions

View File

@ -65,15 +65,14 @@ class ExportController extends Controller
if ($format == 'csv') {
return Excel::download(new DataGridExport($records), last($gridName).'.csv');
} else {
if ($format == 'xls') {
return Excel::download(new DataGridExport($records), last($gridName).'.xlsx');
} else {
session()->flash('warning', trans('admin::app.export.illegal-format'));
return redirect()->back();
}
}
if ($format == 'xls') {
return Excel::download(new DataGridExport($records), last($gridName).'.xlsx');
}
session()->flash('warning', trans('admin::app.export.illegal-format'));
return redirect()->back();
}