This repository was archived by the owner on Mar 18, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
resources/views/components Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change 2
2
<x-dynamic-component :component =" formComponentName('label')"
3
3
:for =" $inputId"
4
4
class =" {{ $inline && ! $isCheckboxGroup ? ' form-group__inline-label' : ' ' } }"
5
+ :id =" $labelId"
5
6
>
6
7
{{ $label } }
7
8
</x-dynamic-component >
Original file line number Diff line number Diff line change @@ -20,6 +20,9 @@ class FormGroup extends BladeComponent
20
20
/** @var string */
21
21
public $ helpText ;
22
22
23
+ /** @var null|string */
24
+ public $ labelId ;
25
+
23
26
public bool $ inline ;
24
27
public bool $ border ;
25
28
public bool $ isCheckboxGroup ;
@@ -32,7 +35,8 @@ public function __construct(
32
35
bool $ showErrors = true ,
33
36
string $ helpText = null ,
34
37
bool $ border = false ,
35
- bool $ isCheckboxGroup = false
38
+ bool $ isCheckboxGroup = false ,
39
+ string $ labelId = null
36
40
) {
37
41
$ this ->name = $ name ;
38
42
$ this ->inputId = $ inputId ?? $ name ;
@@ -42,6 +46,7 @@ public function __construct(
42
46
$ this ->helpText = $ helpText ;
43
47
$ this ->border = $ border ;
44
48
$ this ->isCheckboxGroup = $ isCheckboxGroup ;
49
+ $ this ->labelId = $ labelId ;
45
50
}
46
51
47
52
public function groupClass (): string
You can’t perform that action at this time.
0 commit comments