dashboard changes
This commit is contained in:
@@ -21,10 +21,15 @@ class DashboardExportUser implements FromCollection, WithHeadings
|
||||
$mappedTransactions = collect($this->recentTransactions)->map(function ($transaction) use (&$serial) {
|
||||
return [
|
||||
'Sr No.' => $serial++, // Increment serial number
|
||||
'Name' => $transaction['subscription']['first_name'] . ' ' . $transaction['subscription']['last_name'],
|
||||
'Full Name' => $transaction['subscription']['first_name'] . ' ' . $transaction['subscription']['last_name'],
|
||||
'Customer Id' => $transaction['subscription']['id'],
|
||||
'Amount' => $transaction['amount'],
|
||||
'Payment Details' => $transaction['stripe_customer_id'], // Adjust as needed
|
||||
'Amount' => '$ ' . $transaction['amount'],
|
||||
'Subscription ID' => $transaction['subscription_id'],
|
||||
'Stripe Customer Id' => $transaction['stripe_customer_id'],
|
||||
'Subscription Status' => $transaction['subscription_status'],
|
||||
'Current Start Period' => $transaction['current_period_start'],
|
||||
'Current End Period' => $transaction['current_period_end'],
|
||||
'Next Period Date' => $transaction['next_payment_date'],
|
||||
];
|
||||
});
|
||||
|
||||
@@ -35,10 +40,15 @@ class DashboardExportUser implements FromCollection, WithHeadings
|
||||
{
|
||||
return [
|
||||
'Sr No.',
|
||||
'Name',
|
||||
'Full Name',
|
||||
'Customer Id',
|
||||
'Amount',
|
||||
'Payment Details',
|
||||
'Subscription ID',
|
||||
'Stripe Customer Id',
|
||||
'Subscription Status',
|
||||
'Current Start Period',
|
||||
'Current End Period',
|
||||
'Next Period Date',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,13 +27,17 @@ class DashboardSelectedExportUser implements FromCollection, WithHeadings
|
||||
$mappedTransactions = collect($selectedTransactions)->map(function ($transaction) use (&$serial) {
|
||||
return [
|
||||
'Sr No.' => $serial++, // Increment serial number
|
||||
'Name' => $transaction['subscription']['first_name'] . ' ' . $transaction['subscription']['last_name'],
|
||||
'Full Name' => $transaction['subscription']['first_name'] . ' ' . $transaction['subscription']['last_name'],
|
||||
'Customer Id' => $transaction['subscription']['id'],
|
||||
'Amount' => $transaction['amount'],
|
||||
'Payment Details' => $transaction['stripe_customer_id'], // Adjust as needed
|
||||
|
||||
];
|
||||
'Amount' => '$ ' . $transaction['amount'],
|
||||
'Subscription ID' => $transaction['subscription_id'],
|
||||
'Stripe Customer Id' => $transaction['stripe_customer_id'],
|
||||
'Subscription Status' => $transaction['subscription_status'],
|
||||
'Current Start Period' => $transaction['current_period_start'],
|
||||
'Current End Period' => $transaction['current_period_end'],
|
||||
'Next Period Date' => $transaction['next_payment_date'],
|
||||
|
||||
];
|
||||
});
|
||||
|
||||
return new Collection($mappedTransactions);
|
||||
@@ -43,10 +47,15 @@ class DashboardSelectedExportUser implements FromCollection, WithHeadings
|
||||
{
|
||||
return [
|
||||
'Sr No.',
|
||||
'Name',
|
||||
'Full Name',
|
||||
'Customer Id',
|
||||
'Amount',
|
||||
'Payment Details',
|
||||
'Subscription ID',
|
||||
'Stripe Customer Id',
|
||||
'Subscription Status',
|
||||
'Current Start Period',
|
||||
'Current End Period',
|
||||
'Next Period Date',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ class DashboardController extends Controller
|
||||
$restaurantCount = Subscriptions::where('is_active', 1)->count();
|
||||
$dateTime = now();
|
||||
$formattedDateTime = $dateTime->format('Y-m-d H:i:s');
|
||||
$recent_transaction = Subscriptions::where('next_payment_date', '>=', $formattedDateTime)->with('subscription')->get()->toArray();
|
||||
$recent_transaction = Subscriptions::where('next_payment_date', '>=', $formattedDateTime)->with('subscription')->orderBy('id', 'desc')->get()->toArray();
|
||||
|
||||
|
||||
return view('Admin.dashboard', compact(
|
||||
@@ -162,7 +162,7 @@ class DashboardController extends Controller
|
||||
Created at : 08 July 2024
|
||||
Use : To Get Excel.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
public function exportRecentTransactions(Request $request)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user