File tree Expand file tree Collapse file tree 4 files changed +12
-1
lines changed
resources/views/components
support/resources/views/components Expand file tree Collapse file tree 4 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 1
1
<x-filament::fieldset
2
2
:label =" $getLabel()"
3
3
:label-hidden =" $isLabelHidden()"
4
+ :required =" isset($isMarkedAsRequired) ? $isMarkedAsRequired() : false"
4
5
:attributes ="
5
6
\Filament\Support\prepare_inherited_attributes($attributes)
6
7
->merge([
Original file line number Diff line number Diff line change 8
8
9
9
class Fieldset extends Component implements CanEntangleWithSingularRelationships
10
10
{
11
+ use Concerns \CanBeMarkedAsRequired;
11
12
use Concerns \EntanglesStateWithSingularRelationship;
12
13
13
14
/**
@@ -36,4 +37,9 @@ protected function setUp(): void
36
37
37
38
$ this ->columns (2 );
38
39
}
40
+
41
+ public function isRequired (): bool
42
+ {
43
+ return false ;
44
+ }
39
45
}
Original file line number Diff line number Diff line change 11
11
class MorphToSelect extends Component
12
12
{
13
13
use Concerns \CanAllowHtml;
14
+ use Concerns \CanBeMarkedAsRequired;
14
15
use Concerns \CanBeNative;
15
16
use Concerns \CanBePreloaded;
16
17
use Concerns \CanBeSearchable;
Original file line number Diff line number Diff line change 1
1
@props ([
2
2
' label' => null ,
3
3
' labelHidden' => false ,
4
+ ' required' => false ,
4
5
] )
5
6
6
7
<fieldset
17
18
' sr-only' => $labelHidden ,
18
19
] )
19
20
>
20
- {{ $label } }
21
+ {{-- Deliberately poor formatting to ensure that the asterisk sticks to the final word in the label. --}}
22
+ {{ $label } }@if ($required )<sup class =" text-danger-600 dark:text-danger-400 font-medium" >*</sup >
23
+ @endif
21
24
</legend >
22
25
@endif
23
26
You can’t perform that action at this time.
0 commit comments