@extends('admin.layouts.master') @section('page-header') @endsection @section('content')

بيانات المستوى

@if ($errors->any())
    @foreach ($errors->all() as $error)
  • {{ $error }}
  • @endforeach
@endif
@csrf
{{ __('Key cannot be changed') }}
{{ __('Tier order cannot be changed') }}
@php $iconOptions = [ 'user' => 'Person', 'award' => 'Award', 'star' => 'Star', 'star-half' => 'Star Half', 'gem' => 'Gem', 'trophy' => 'Trophy', 'sparkles' => 'Sparkles', 'heart' => 'Heart', 'gift' => 'Gift', 'zap' => 'Lightning', 'rocket' => 'Rocket', 'shield-check' => 'Shield Check', 'flag' => 'Flag', 'smile' => 'Smile', 'badge-check' => 'Badge Check', ]; $aliases = [ 'personfill' => 'user', 'awardfill' => 'award', 'starfill' => 'star', 'starhalf' => 'star-half', 'gem' => 'gem', 'trophyfill' => 'trophy', 'stars' => 'sparkles', 'person' => 'user', ]; $currentIcon = trim(($errors->any() ? old('icon_class') : $level->icon_class) ?? ''); $normalize = fn($s) => strtolower(str_replace([' ', '-', '_'], '', trim((string) $s))); $normalizedKey = $normalize($currentIcon); $previewIconName = $currentIcon; if (isset($aliases[$normalizedKey])) { $previewIconName = $aliases[$normalizedKey]; } $normalizedOptions = []; foreach ($iconOptions as $k => $lbl) { $normalizedOptions[$normalize($k)] = $k; } $selectedNormalized = $normalize($currentIcon); $selectedExists = $currentIcon && array_key_exists($selectedNormalized, $normalizedOptions); // Pre-render all icon SVGs server-side for use in JS $iconSvgMap = []; foreach ($iconOptions as $name => $label) { $iconSvgMap[$name] = svg('lucide-' . $name, ['width' => 18, 'height' => 18])->toHtml(); } @endphp {{ __('You can choose from common icons or type a custom Lucide icon name (e.g., star, trophy).') }}
{{ __('Cancel') }}
@endsection @section('css') @endsection @section('js') @endsection