@props([ 'label' => null, 'model' => null, 'lazy' => false, 'size' => null, 'type' => 'checkbox', 'noControl' => false, 'formControlClass' => '', 'labelClass' => '', 'pro' => true, 'key' => null, ]) @php if ($lazy) $bind = 'lazy'; else $bind = 'defer'; $wireModel = $attributes->whereStartsWith('wire:model')->first(); $key = $key ?? $attributes->get('name', $model ?? $wireModel); $id = "control-" . uniqid(); $attributes = $attributes->class([ 'custom-control-input', 'is-invalid' => $errors->has($key), ])->merge([ 'type' => $type, 'id' => $id, 'name' => $key, 'wire:model.' . $bind => $model ? $model : null, ]); @endphp
$pro, "custom-$type", "custom-control-$size" => $size, "no-control" => $noControl ]) >