Skip to content

Commit 3f16b20

Browse files
Rating: allow zero (#496)
Allow `0` As not rated yet.
1 parent a7f133d commit 3f16b20

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/View/Components/Rating.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,16 @@ public function size(): ?string
2929
public function render(): View|Closure|string
3030
{
3131
return <<<'HTML'
32-
<div class="rating gap-1 {{ $size }}">
32+
<div class="rating gap-1 {{ $size }}" x-cloak>
33+
<!-- NO RATING-->
34+
<input
35+
type="radio"
36+
name="{{ $modelName() }}"
37+
value="0"
38+
class="rating-hidden hidden"
39+
{{ $attributes->whereStartsWith('wire:model') }}
40+
/>
41+
3342
@for ($i = 1; $i <= $total; $i++)
3443
<input
3544
type="radio"

0 commit comments

Comments
 (0)