captcha.blade.php 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <x-dynamic-component :component="$getFieldWrapperView()" :field="$field" :inline-label-vertical-alignment="\Filament\Support\Enums\VerticalAlignment::Center">
  2. <div x-data="{ state: $wire.$entangle('{{ $getStatePath() }}').defer }">
  3. <!-- Interact with the `state` property in Alpine.js -->
  4. <x-filament::input.wrapper :disabled="$isDisabled()" :inline-prefix="$isPrefixInline()" :inline-suffix="$isSuffixInline()" :prefix="$getPrefixLabel()"
  5. :prefix-actions="$getPrefixActions()" :prefix-icon="$getPrefixIcon()" :prefix-icon-color="$getPrefixIconColor()" :suffix="$getSuffixLabel()" :suffix-actions="$getSuffixActions()"
  6. :suffix-icon="$getSuffixIcon()" :suffix-icon-color="$getSuffixIconColor()" :valid="!$errors->has($getStatePath())" x-data="{}" :attributes="\Filament\Support\prepare_inherited_attributes($getExtraAttributeBag())->class([
  7. 'fi-fo-text-input overflow-hidden',
  8. ])">
  9. <x-filament::input :attributes="\Filament\Support\prepare_inherited_attributes($getExtraInputAttributeBag())
  10. ->merge($getExtraAlpineAttributes(), escape: false)
  11. ->merge(
  12. [
  13. 'autofocus' => $isAutofocused(),
  14. 'disabled' => $isDisabled(),
  15. 'id' => $getId(),
  16. 'inlinePrefix' =>
  17. $isPrefixInline() &&
  18. (count($getPrefixActions()) || $getPrefixIcon() || filled($getPrefixLabel())),
  19. 'inlineSuffix' =>
  20. $isSuffixInline() &&
  21. (count($getSuffixActions()) || $getSuffixIcon() || filled($getSuffixLabel())),
  22. 'maxlength' => !$isConcealed ? $getMaxLength() : null,
  23. 'minlength' => !$isConcealed ? $getMinLength() : null,
  24. 'required' => $isRequired() && !$isConcealed,
  25. 'type' => 'text',
  26. $applyStateBindingModifiers('wire:model') => $getStatePath(),
  27. ],
  28. escape: false,
  29. )
  30. ->merge([])
  31. ->class(['fi-fo-text-input overflow-hidden'])" />
  32. </x-filament::input.wrapper>
  33. </div>
  34. <div class="pt-10">
  35. @switch(config('filament-captcha.engine', 'mews'))
  36. @case('mews')
  37. @default
  38. {!! Captcha::img() !!}
  39. @break
  40. @endswitch
  41. </div>
  42. </x-dynamic-component>