@extends('backend.layouts.app') @section('title', __('Manage Feature: :name', ['name' => $feature->label])) @push('styles') @endpush @section('content')
@csrf @method('PUT') {{-- Header --}}
{{ __('Back') }}

{{ __($feature->label) }}

{{ $feature->is_enabled ? __('Active') : __('Disabled') }} @if($feature->is_core) {{ __('Core') }} @endif

{{ __($feature->description) }} {{ $feature->key }}

{{-- Global toggle --}}

{{ __('Global Availability') }}

{{ __('Master switch - off hides this feature everywhere, regardless of panel rules below.') }}

{{-- Per-panel rules --}}

{{ __('Panel Visibility & Access') }}

{{ __('Visibility controls menus and UI entry points. Access controls routes, actions, and APIs.') }}

@php $catalogRules = (array) config("feature_catalog.features.{$feature->key}.rules", []); $supportsIdentifierMix = array_key_exists('identifier_methods', $catalogRules); @endphp @foreach($rulesByPanel as $panel => $rule) @php $conditions = (array) $rule->conditions; $countries = implode(', ', (array) data_get($conditions, 'countries_allowed', [])); $requiresKyc = (bool) data_get($conditions, 'requires_kyc'); $requiresPhone = (bool) data_get($conditions, 'requires_phone'); $allowWalletId = (bool) data_get($conditions, 'identifier_methods.wallet_id', data_get($catalogRules, 'identifier_methods.wallet_id', false)); $allowEmail = (bool) data_get($conditions, 'identifier_methods.email', data_get($catalogRules, 'identifier_methods.email', false)); $allowMobile = (bool) data_get($conditions, 'identifier_methods.mobile', data_get($catalogRules, 'identifier_methods.mobile', false)); $verifiedEmail = (bool) data_get($conditions, 'require_verified_email', false); $verifiedMobile = (bool) data_get($conditions, 'require_verified_mobile', false); $panelIcons = [ \App\Models\FeatureAccessRule::PANEL_USER => 'fa-user', \App\Models\FeatureAccessRule::PANEL_MERCHANT => 'fa-store', \App\Models\FeatureAccessRule::PANEL_AGENT => 'fa-user-tie', ]; $enabledRules = collect([$rule->is_visible, $rule->is_accessible, $requiresKyc, $requiresPhone])->filter()->count(); $panelLabel = $panelOptions[$panel] ?? ucfirst($panel); @endphp
{{ $panelLabel }}

{{ __(':panel level controls', ['panel' => $panelLabel]) }}

{{ $enabledRules }} {{ __('rules on') }} {{ $countries === '' ? __('All countries') : __('Limited') }}
{{ $rule->is_visible ? __('Visible') : __('Hidden') }} {{ $rule->is_accessible ? __('Accessible') : __('Blocked') }} {{ $requiresKyc ? __('KYC required') : __('No KYC gate') }} {{ $requiresPhone ? __('Phone required') : __('No phone gate') }}
@if($supportsIdentifierMix)
{{ __('Recipient Identifier Methods') }} {{ __('Choose how a recipient can be looked up on this panel. Verified-only toggles enforce verification on the matched account.') }}
@endif
{{ __('Allowed Countries') }} {{ __('Comma-separated ISO codes - empty allows every country.') }}
@endforeach
@endsection