@extends('layouts.app') @section('title', 'Gestión de Roles') @section('content')

Gestión de Roles y Permisos

@forelse($roles as $role) @empty @endforelse
Rol Descripción Guard Usuarios Permisos Estado Acciones
{{ $role->name }}
ID: {{ $role->id }}
{{ $role->description ?? 'Sin descripción' }}
{{ $role->guard_name }} {{ $role->users_count ?? 0 }}
@foreach($role->permissions->take(3) as $permission) {{ $permission->name }} @endforeach @if($role->permissions->count() > 3) +{{ $role->permissions->count() - 3 }} más @endif
{{ $role->is_active ? 'Activo' : 'Inactivo' }}
@can('role-edit') @endcan @can('role-permissions') @endcan @can('role-delete') @if(!in_array($role->name, ['super-admin', 'admin'])) @endif @endcan
No hay roles disponibles
@if($roles->hasPages())
{{ $roles->links() }}
@endif
@endsection @push('scripts') @endpush @php function getRoleIcon($roleName) { $icons = [ 'super-admin' => 'fa-crown', 'admin' => 'fa-user-shield', 'gerente' => 'fa-user-tie', 'supervisor' => 'fa-user-check', 'tecnico' => 'fa-tools', 'operador' => 'fa-user', 'cliente' => 'fa-user-circle' ]; return $icons[$roleName] ?? 'fa-user-tag'; } function getRoleColor($roleName) { $colors = [ 'super-admin' => 'danger', 'admin' => 'warning', 'gerente' => 'info', 'supervisor' => 'primary', 'tecnico' => 'success', 'operador' => 'secondary', 'cliente' => 'dark' ]; return $colors[$roleName] ?? 'secondary'; } @endphp