-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinput.blade.php
More file actions
37 lines (30 loc) · 1.14 KB
/
input.blade.php
File metadata and controls
37 lines (30 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
@props([
'label',
'name' => $attributes->whereStartsWith('wire:model')->first(),
'description' => null,
'descriptionTrailing' => null,
'badge' => null,
])
@php
$badge ??= $attributes->whereStartsWith('required')->isNotEmpty() ? 'Required' : null;
@endphp
{{-- @see https://fluxui.dev/components/input --}}
<flux:field :attributes="Flux::attributesAfter('field:', $attributes, [])">
<flux:label
:attributes="Flux::attributesAfter('label:', $attributes, ['badge' => $badge])"
>{!! $label !!}</flux:label>
@if ($description)
<flux:description
class="-mt-1! mb-1!"
:attributes="Flux::attributesAfter('description:', $attributes, [])"
>{!! $description !!}</flux:description>
@endif
<flux:input :$name :$attributes />
<flux:error :attributes="Flux::attributesAfter('error:', $attributes, ['name' => $name])" />
@if ($descriptionTrailing)
<flux:description
class="-mt-4! mb-5!"
:attributes="Flux::attributesAfter('descriptionTrailing:', $attributes, [])"
>{!! $descriptionTrailing !!}</flux:description>
@endif
</flux:field>