diff --git a/app/Http/Controllers/Admin/DashboardController.php b/app/Http/Controllers/Admin/DashboardController.php index 6bc7793..755477c 100644 --- a/app/Http/Controllers/Admin/DashboardController.php +++ b/app/Http/Controllers/Admin/DashboardController.php @@ -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'); } diff --git a/resources/views/Admin/dashboard.blade.php b/resources/views/Admin/dashboard.blade.php index 019dbf6..9c62af1 100644 --- a/resources/views/Admin/dashboard.blade.php +++ b/resources/views/Admin/dashboard.blade.php @@ -105,7 +105,7 @@ $currentPage = 'dashboard';