@extends('layouts.app') @push('styles') @endpush @section('content')
@csrf

Informações Básicas

Dados principais do papel

@error('name')
{{ $message }}
@enderror
@error('description')
{{ $message }}
@enderror

Permissões

Defina quais ações este papel pode executar

@php // Funções auxiliares para ícones e labels dinâmicos function getModuleIcon($module) { $icons = [ 'users' => 'people', 'roles' => 'shield-check', 'settings' => 'gear', 'amazon_affiliate' => 'cart-check', 'affiliate_footers' => 'card-text', 'monitoring' => 'broadcast-pin', 'plans' => 'layers', ]; return $icons[$module] ?? 'circle'; } function getModuleLabel($module) { $labels = [ 'users' => 'Usuários', 'roles' => 'Papéis', 'settings' => 'Configurações', 'amazon_affiliate' => 'Amazon Affiliate', 'affiliate_footers' => 'Textos de Rodapé', 'monitoring' => 'Monitoramento', 'plans' => 'Planos', ]; return $labels[$module] ?? ucfirst($module); } function getActionIcon($action) { $icons = [ 'view' => 'eye', 'create' => 'plus-circle', 'edit' => 'pencil', 'delete' => 'trash', 'manage' => 'gear', 'analyze' => 'search', ]; return $icons[$action] ?? 'check-circle'; } function getActionLabel($action) { $labels = [ 'view' => 'Visualizar', 'create' => 'Criar', 'edit' => 'Editar', 'delete' => 'Excluir', 'manage' => 'Gerenciar', 'analyze' => 'Analisar', ]; return $labels[$action] ?? ucfirst($action); } @endphp
@foreach($permissions as $group => $groupPermissions)

{{ getModuleLabel($group) }}

@foreach($groupPermissions as $permission)
@php $parts = explode('.', $permission->name); $action = end($parts); $module = $parts[0]; $moduleLabel = getModuleLabel($module); $actionLabel = getActionLabel($action); $label = $actionLabel . ' ' . $moduleLabel; $actionIcon = getActionIcon($action); @endphp
@endforeach
@endforeach
Cancelar
@endsection