{{-- Checkbox Component A checkbox with authorization support, label positioning, and description. Props: - id: string (required) - Checkbox element ID - label: string|null - Label text - description: string|null - Description text below label - error: string|null - Error message - labelPosition: string - Label position: 'left' or 'right' (default: 'right') - disabled: bool - Whether checkbox is disabled - canGate: string|null - Gate/ability to check - canResource: mixed|null - Resource to check against - canHide: bool - Hide instead of disable when unauthorized Usage: {{-- Label on left --}} --}} @if(!$hidden)
only(['class', 'x-show', 'x-if', 'x-cloak'])->merge(['class' => 'space-y-1']) }}>
$labelPosition === 'left', ])> {{-- Checkbox --}}
except(['class', 'x-show', 'x-if', 'x-cloak'])->class([ 'h-4 w-4 rounded transition-colors duration-200', 'border-gray-300 dark:border-gray-600', 'text-violet-600 dark:text-violet-500', 'focus:ring-2 focus:ring-violet-500/20 focus:ring-offset-0', 'bg-white dark:bg-gray-800', // Disabled state 'bg-gray-100 dark:bg-gray-900 cursor-not-allowed' => $disabled, ]) }} />
{{-- Label and description --}} @if($label || $description)
@if($label) @endif @if($description)

{{ $description }}

@endif
@endif
{{-- Error message --}} @if($error)

{{ $error }}

@elseif($errors->has($id))

{{ $errors->first($id) }}

@endif
@endif