File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- @if ($label || $blankLabel )
2- <label {!! $attributes -> merge ([' class' => ($floating ? null : ($inline ? $inlineLabelClass : ' form-label' ))]) ! !} >{{ $label } }@if ($required ) <x-forms::label-required :framework =" $framework" />@endif </label >
1+ @if ($slot -> isNotEmpty () || $label || $blankLabel )
2+ <label {!! $attributes -> merge ([' class' => ($floating ? null : ($inline ? $inlineLabelClass : ' form-label' ))]) ! !} >
3+ @if ($slot -> isNotEmpty () )
4+ {{ $slot } }
5+ @else
6+ {{ $label } }
7+ @if ($required ) <x-forms::label-required :framework =" $framework" />@endif
8+ @endif
9+ </label >
310@endif
Original file line number Diff line number Diff line change 11@if ($label || $blankLabel )
22 <label {!! $attributes -> merge ([
33 ' class' => (! $floating && $inline ? $inlineLabelClass : null )]) ! !} >
4- {{ $label } }
5- @if ($required )
6- <x-forms::label-required :framework =" $framework" ></x-forms::label-required >
4+ @if ($slot -> isNotEmpty () )
5+ {{ $slot } }
6+ @else
7+ {{ $label } }
8+ @if ($required ) <x-forms::label-required :framework =" $framework" />@endif
79 @endif
810 </label >
911@endif
Original file line number Diff line number Diff line change @@ -14,6 +14,32 @@ public function setUp(): void
1414 Config::set ('forms.inputs.required_text ' , 'forms::strings.required_text ' );
1515 }
1616
17+ public function test_it_can_generate_material_admin_label_with_a_slot ()
18+ {
19+ $ this ->setFrameworkMaterialAdmin26 ();
20+ $ this ->registerTestRoute ('label-slot ' );
21+
22+ $ this ->visit ('/label-slot ' )
23+ ->seeElementCount ('label ' , 1 )
24+ ->within ('label ' , function () {
25+ $ this ->seeElement ('a ' )
26+ ->seeInElement ('a ' , 'some site ' );
27+ });
28+ }
29+
30+ public function test_it_can_generate_bootstrap_5_label_with_a_slot ()
31+ {
32+ $ this ->setFrameworkBootstrap5 ();
33+ $ this ->registerTestRoute ('label-slot ' );
34+
35+ $ this ->visit ('/label-slot ' )
36+ ->seeElementCount ('label ' , 1 )
37+ ->within ('label ' , function () {
38+ $ this ->seeElement ('a ' )
39+ ->seeInElement ('a ' , 'some site ' );
40+ });
41+ }
42+
1743 public function test_it_can_generate_bootstrap_5_blank_form_group ()
1844 {
1945 $ this ->setFrameworkBootstrap5 ();
Original file line number Diff line number Diff line change 1+ <x-forms::label >
2+ Go to <a href =" https://example.com" >some site</a >.
3+ </x-forms::label >
You can’t perform that action at this time.
0 commit comments