43 lines
1.3 KiB
PHP
43 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Admin;
|
|
use App\Models\IamPrincipal;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Support\Facades\Log;
|
|
use Illuminate\Support\Facades\DB;
|
|
use Maatwebsite\Excel\Facades\Excel;
|
|
use App\Models\OrderedPassport;
|
|
use Exception;
|
|
|
|
|
|
class ManageCustomerController extends Controller
|
|
{
|
|
// public function index(){
|
|
|
|
|
|
// 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);
|
|
}
|
|
}
|
|
|
|
}
|