Files
2026-07-23 17:23:57 +01:00

63 lines
3.3 KiB
PHP

<x-layouts.app :title="__('Users')">
<div class="space-y-6">
<div class="flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between">
<div>
<h1 class="text-2xl font-semibold tracking-tight text-zinc-950 dark:text-zinc-100">Users</h1>
<p class="mt-1 text-sm text-zinc-600 dark:text-zinc-400">Create, edit and soft delete backend user accounts.</p>
</div>
<flux:button :href="route('administration.users.create')" variant="primary" wire:navigate>
Create user
</flux:button>
</div>
@if (session('status'))
<div class="rounded-xl border border-emerald-200 bg-emerald-50 px-4 py-3 text-sm text-emerald-800 dark:border-emerald-900/60 dark:bg-emerald-950/40 dark:text-emerald-200">
{{ session('status') }}
</div>
@endif
<div class="overflow-hidden rounded-xl border border-zinc-200 bg-white shadow-sm dark:border-zinc-700 dark:bg-zinc-900">
<table class="min-w-full divide-y divide-zinc-200 text-sm dark:divide-zinc-700">
<thead class="bg-zinc-50 text-left text-xs font-semibold uppercase tracking-wide text-zinc-600 dark:bg-zinc-950 dark:text-zinc-400">
<tr>
<th class="px-4 py-3">Name</th>
<th class="px-4 py-3">Email</th>
<th class="px-4 py-3">Roles</th>
<th class="px-4 py-3 text-right">Actions</th>
</tr>
</thead>
<tbody class="divide-y divide-zinc-200 dark:divide-zinc-800">
@forelse ($users as $user)
<tr>
<td class="px-4 py-3 font-medium text-zinc-950 dark:text-zinc-100">{{ $user->name }}</td>
<td class="px-4 py-3 text-zinc-600 dark:text-zinc-400">{{ $user->email }}</td>
<td class="px-4 py-3 text-zinc-600 dark:text-zinc-400">
{{ $user->roles->pluck('name')->join(', ') ?: '—' }}
</td>
<td class="px-4 py-3">
<div class="flex justify-end gap-2">
<flux:button size="sm" :href="route('administration.users.edit', $user)" wire:navigate>Edit</flux:button>
<form method="POST" action="{{ route('administration.users.destroy', $user) }}">
@csrf
@method('DELETE')
<flux:button size="sm" variant="danger" type="submit">Delete</flux:button>
</form>
</div>
</td>
</tr>
@empty
<tr>
<td colspan="4" class="px-4 py-8 text-center text-zinc-600 dark:text-zinc-400">No users found.</td>
</tr>
@endforelse
</tbody>
</table>
</div>
@if (method_exists($users, 'links'))
{{ $users->links() }}
@endif
</div>
</x-layouts.app>