@extends('layouts.admin') @section('styles') @endsection @section('content')
@if (session('success'))
{{ session('success') }}
@endif @if (session('error'))
{{ session('error') }}
@endif {{-- Re-open modal on validation error --}} @if ($errors->any())
{{ $errors->first() }}
@endif {{-- ── FILTER ── --}}
@if (request('search') || request('role') || request('status')) Reset @endif
{{-- ── TABLE ── --}}
Semua Pengguna {{ $pengguna->total() }} pengguna ditemukan
@php $avatarBg = [ '#2563eb', '#7c3aed', '#0891b2', '#059669', '#d97706', '#dc2626', '#9333ea', '#0d9488', ]; @endphp @forelse($pengguna as $i => $usr) @php $initials = collect(explode(' ', $usr->name)) ->map(fn($w) => strtoupper($w[0] ?? '')) ->take(2) ->implode(''); $bg = $avatarBg[$i % count($avatarBg)]; $roleBadge = match ($usr->role) { 'admin' => 'b-red', 'operator' => 'b-blue', default => 'b-gray', }; $roleLabel = match ($usr->role) { 'admin' => 'Admin', 'operator' => 'Operator', default => 'Pengguna', }; $isVerified = $usr->sudah_verifikasi; @endphp @empty @endforelse
Pengguna Kontak Role Bergabung Status Aksi
@if ($usr->foto_profil_url) {{ $usr->name }} @else {{ $initials }} @endif
{{ $usr->name }}
ID #{{ $usr->id }}
{{ $usr->email }}
@if ($usr->no_telepon)
{{ $usr->no_telepon }}
@endif
{{ $roleLabel }} {{ $usr->created_at->format('d M Y') }} @if ($isVerified) ● Terverifikasi @else ● Belum Verifikasi @endif
Tidak ada pengguna yang ditemukan.
@if ($pengguna->hasPages())
Menampilkan {{ $pengguna->firstItem() }}–{{ $pengguna->lastItem() }} dari {{ $pengguna->total() }} pengguna
@endif
{{-- ═══════════════════════ MODAL: TAMBAH PENGGUNA ════════════════════════ --}} {{-- ═══════════════════════ MODAL: EDIT PENGGUNA ════════════════════════ --}} {{-- ══════════════════════════ MODAL: CONFIRM DELETE ══════════════════════════ --}} @endsection @section('scripts') @if ($errors->any()) @endif @endsection