{{-- Toggle Component A toggle switch with authorization support and instant save capability. Props: - id: string (required) - Toggle element ID - label: string|null - Label text - description: string|null - Description text - error: string|null - Error message - size: string - Toggle size: sm, md, lg - instantSave: bool - Enable instant save on change - instantSaveMethod: string|null - Livewire method to call on change - disabled: bool - Whether toggle 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: {{-- With instant save --}} --}} @if(!$hidden)
only(['class', 'x-show', 'x-if', 'x-cloak'])->merge(['class' => 'space-y-1']) }}>
{{-- Label and description --}} @if($label || $description)
@if($label) @endif @if($description)

{{ $description }}

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

{{ $error }}

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

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

@endif
@endif