@extends('adminlte::page') @section('title', 'Kullanıcı & Yetki Yönetimi') @section('content')
{{-- Toast --}}
{{-- Session Mesajları --}} @if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif {{-- Başlık --}}
Kullanıcı & Yetki Yönetimi
{{ $users->count() }} kullanıcı  ·  {{ $roles->count() }} rol  ·  {{ collect($groupedPermissions)->sum(fn($g) => count($g['actions'])) }} izin
@can('user.create') Yeni Kullanıcı @endcan
{{-- Sekme Navigasyon --}}
{{-- ══════════════════════════════════════════════════ --}} {{-- SEKME 1: KULLANICILAR --}} {{-- ══════════════════════════════════════════════════ --}}
{{-- Arama --}}
@foreach($users as $index => $user) @php $avatarColor = 'avatar-' . ($index % 8); $initials = collect(explode(' ', $user->name))->map(fn($w) => strtoupper($w[0] ?? ''))->take(2)->join(''); @endphp
{{ $initials }}
{{ $user->name }}
{{ $user->email }}
@forelse($user->roles as $role) {{ $role->name }} @empty Rol yok @endforelse
{{ optional($user->branch)->name ?? 'Şube atanmamış' }}
{{-- Düzenle / Sil butonları --}}
@can('user.update') @endcan @can('user.delete') @if($user->id !== auth()->id())
@csrf @method('DELETE')
@endif @endcan
@foreach($roles as $role) @endforeach
@endforeach
{{-- ══════════════════════════════════════════════════ --}} {{-- SEKME 2: ROLLER --}} {{-- ══════════════════════════════════════════════════ --}}
{{-- Yeni Rol Butonu --}} @can('role.create')
{{-- Yeni Rol Formu --}} @endcan {{-- Rol Listesi --}} @foreach($roles as $role) @php $isSystem = in_array($role->name, ['admin', 'sistem yöneticisi']); @endphp
{{ $role->name }} @if($isSystem) Sistem @endif
{{ $role->permissions->count() }} izin @if(!$isSystem) @can('role.delete') @endcan @endif
@can('role.update')
@endcan @foreach($groupedPermissions as $moduleKey => $group)
{{ $group['label'] }} @can('role.update') Hepsini seç Temizle @endcan
@foreach($group['actions'] as $action) @endforeach
@endforeach @can('role.update')
@endcan
@endforeach
{{-- ══════════════════════════════════════════════════ --}} {{-- SEKME 3: İZİNLER --}} {{-- ══════════════════════════════════════════════════ --}}

Tüm sistem izinleri aşağıda listelenmiştir. İzinler config/permissions.php dosyasından yönetilir.

@foreach($groupedPermissions as $moduleKey => $group)
{{ $group['label'] }} {{ count($group['actions']) }} izin
@foreach($group['actions'] as $action) {{ $action['name'] }} {{ $action['label'] }} @endforeach
@endforeach
@endsection @section('js') @endsection