Files
cheerstothe_season_2.0/app/Http/Controllers/Admin/ManageCustomerController.php

43 lines
1.3 KiB
PHP
Raw Normal View History

2024-05-23 15:20:21 +05:30
<?php
namespace App\Http\Controllers\Admin;
2024-05-28 12:45:23 +05:30
use App\Models\IamPrincipal;
2024-05-23 15:20:21 +05:30
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
2024-05-28 12:45:23 +05:30
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\DB;
use Maatwebsite\Excel\Facades\Excel;
use App\Models\OrderedPassport;
use Exception;
2024-05-23 15:20:21 +05:30
class ManageCustomerController extends Controller
{
2024-05-28 12:45:23 +05:30
// public function index(){
2024-05-23 15:20:21 +05:30
2024-05-28 12:45:23 +05:30
// return view('Admin.pages.manage_users.manage_customer.customer');
// }
public function index()
{
try {
$customers = IamPrincipal::where('principal_type_xid', 3)->orderBy('created_at', 'desc')->get();
// foreach ($customers as $customer) {
// $activePassportCount = OrderedPassport::where('iam_principal_xid', $customer->id)
// ->where('is_active', 1) // Assuming 'status' field indicates the status of the passport
// ->count();
// $customer->activePassportCount = $activePassportCount;
// }
return view('Admin.pages.manage_users.manage_customer.customer', compact('customers'));
} catch (Exception $e) {
Log::error("Manage Voucher Page Not Load " . $e->getMessage());
return jsonResponseWithErrorMessage(__('auth.something_went_wrong'), 500);
}
2024-05-23 15:20:21 +05:30
}
2024-05-28 12:45:23 +05:30
2024-05-23 15:20:21 +05:30
}