@extends('layout.app') @section('content')
{{-- Header Tabel & Dropdown Per Page --}}
Data Pengguna
{{-- Dropdown Pilihan Halaman --}}
{{-- Tabel Data Pengguna --}}
@forelse($users as $user) @empty @endforelse
No Nama Lengkap Username Role Status Aksi
{{ $users->firstItem() + $loop->index }} {{ $user->nama_lengkap }} {{ $user->username }} {{ ucfirst($user->role) }} {{-- Badge Status --}} @if($user->status === 'aktif') Aktif @else Nonaktif @endif
{{-- Tombol Edit --}} {{-- Tombol Toggle Status (HANYA MUNCUL JIKA BUKAN AKUN SENDIRI) --}} @if (auth()->user()->role === 'admin' && auth()->id() !== $user->id)
@csrf @method('PATCH') {{-- Jika Aktif, tombol berwarna abu-abu (untuk menonaktifkan). Jika Nonaktif, tombol hijau (untuk mengaktifkan) --}}
@endif {{-- Tombol Reset Password --}} @if (auth()->user()->role === 'admin')
@csrf
@endif {{-- Tombol Hapus (HANYA MUNCUL JIKA BUKAN AKUN SENDIRI) --}} @if (auth()->id() !== $user->id)
@csrf @method('DELETE')
@endif
Data tidak ditemukan.
{{-- Menampilkan Tombol Next / Previous --}}
Menampilkan {{ $users->firstItem() ?? 0 }} sampai {{ $users->lastItem() ?? 0 }} dari total {{ $users->total() }} data
{{ $users->links('pagination::bootstrap-4') }}
{{-- Script SweetAlert2 --}} @endsection