RecentDash

This commit is contained in:
sayaliparab
2024-07-09 12:46:01 +05:30
parent a6df2e54ec
commit d71d0d9dbc
4 changed files with 51 additions and 30 deletions

View File

@@ -162,12 +162,28 @@ class DashboardController extends Controller
Created at : 08 July 2024
Use : To Get Excel.
*/
// public function exportRecentTransactions(Request $request)
// {
// try {
// if ($request->has('all_id')) {
// $recentTransaction = Subscriptions::with('subscription')->get()->toArray();
// // return $recentTransaction;
// return Excel::download(new DashboardExportUser($recentTransaction), 'recent_transactions.xlsx');
// }
// $ids = $request->input('selected_id');
// $fileName = 'selected_customer_transaction_data.xlsx';
// return Excel::download(new DashboardSelectedExportUser($ids), $fileName);
// } catch (\Exception $e) {
// return response()->json(['error' => 'Export failed. Something went wrong.'], 500);
// }
// }
public function exportRecentTransactions(Request $request)
{
try {
if ($request->has('all_id')) {
$recentTransaction = Subscriptions::with('subscription')->get()->toArray();
// return $recentTransaction;
return Excel::download(new DashboardExportUser($recentTransaction), 'recent_transactions.xlsx');
}