Skip to content

Commit 23cb53b

Browse files
[1.x] Slot Empty Checking & Return Default Value (#389)
* Slot Empty Checking & Return Default Value Component slot return always HtmlString. That's why while using <x-action-message on="saved" /> isset isn't checking & default 'saved.' text not showing. isEmpty() check could show default message. * Update action-message.blade.php Co-authored-by: Dries Vints <[email protected]>
1 parent 97aa70c commit 23cb53b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: resources/views/components/action-message.blade.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
x-show.transition.opacity.out.duration.1500ms="shown"
66
style="display: none;"
77
{{ $attributes->merge(['class' => 'text-sm text-gray-600']) }}>
8-
{{ $slot ?? 'Saved.' }}
8+
{{ $slot->isEmpty() ? 'Saved.' : $slot }}
99
</div>

0 commit comments

Comments
 (0)