Files
marcoandClaude Sonnet 4.6 685bd0fa9f
Deploy to Production (witstore.wende.it) / deploy (push) Successful in 6s
Add admin user management (create, edit, password change, delete)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-20 18:59:59 +02:00

58 lines
2.7 KiB
PHP

@extends('layouts.admin')
@section('title', 'Admin-Benutzer')
@section('content')
<div class="flex items-center justify-between mb-6">
<h1 class="text-2xl font-bold">Admin-Benutzer</h1>
<a href="{{ route('admin.admins.create') }}" class="bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 text-sm font-medium">
+ Neuer Admin
</a>
</div>
@if(session('success'))
<div class="bg-green-100 border border-green-300 text-green-800 px-4 py-3 rounded-lg mb-4">{{ session('success') }}</div>
@endif
<div class="bg-white rounded-lg border overflow-hidden">
<table class="w-full text-sm">
<thead class="bg-gray-50 border-b">
<tr>
<th class="text-left px-4 py-3 font-medium text-gray-600">Name</th>
<th class="text-left px-4 py-3 font-medium text-gray-600">E-Mail</th>
<th class="text-left px-4 py-3 font-medium text-gray-600">Rolle</th>
<th class="text-left px-4 py-3 font-medium text-gray-600">Erstellt</th>
<th class="px-4 py-3"></th>
</tr>
</thead>
<tbody class="divide-y">
@foreach($admins as $a)
<tr class="hover:bg-gray-50">
<td class="px-4 py-3 font-medium">
{{ $a->name }}
@if($a->id === auth()->id()) <span class="text-xs text-blue-500">(Sie)</span> @endif
</td>
<td class="px-4 py-3 text-gray-600">{{ $a->email }}</td>
<td class="px-4 py-3">
@if($a->role === 'super_admin')
<span class="bg-purple-100 text-purple-700 text-xs px-2 py-0.5 rounded-full">Super-Admin</span>
@else
<span class="bg-blue-100 text-blue-700 text-xs px-2 py-0.5 rounded-full">Admin</span>
@endif
</td>
<td class="px-4 py-3 text-gray-500">{{ $a->created_at->format('d.m.Y') }}</td>
<td class="px-4 py-3 text-right space-x-2">
<a href="{{ route('admin.admins.edit', $a) }}" class="text-blue-600 hover:underline text-xs">Bearbeiten</a>
@if($a->id !== auth()->id())
<form method="POST" action="{{ route('admin.admins.destroy', $a) }}" class="inline"
onsubmit="return confirm('{{ $a->name }} wirklich löschen?')">
@csrf @method('DELETE')
<button class="text-red-500 hover:underline text-xs">Löschen</button>
</form>
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@endsection