diff --git a/src/DataTransferObjects/Filters/FilterPillData.php b/src/DataTransferObjects/Filters/FilterPillData.php index 7dcaffc5d..d6608161f 100644 --- a/src/DataTransferObjects/Filters/FilterPillData.php +++ b/src/DataTransferObjects/Filters/FilterPillData.php @@ -58,7 +58,7 @@ public function getCustomResetButtonAttributes(): array public function getIsAnExternalLivewireFilter(): int { - return intval($this->isAnExternalLivewireFilter ?? false); + return intval($this->isAnExternalLivewireFilter ?? 0); } public function getSeparator(): string @@ -68,17 +68,17 @@ public function getSeparator(): string public function shouldUsePillsAsHtml(): int { - return intval($this->renderPillsAsHtml ?? false); + return intval($this->renderPillsAsHtml ?? 0); } public function shouldUsePillsTitleAsHtml(): int { - return intval($this->renderPillsTitleAsHtml ?? false); + return intval($this->renderPillsTitleAsHtml ?? 0); } public function shouldWatchForEvents(): int { - return intval($this->watchForEvents ?? false); + return intval($this->watchForEvents ?? 0); } public function isPillValueAnArray(): bool diff --git a/src/View/Components/FilterPill.php b/src/View/Components/FilterPill.php index 6ec3f574e..31a9f5344 100644 --- a/src/View/Components/FilterPill.php +++ b/src/View/Components/FilterPill.php @@ -11,7 +11,7 @@ class FilterPill extends Component public function __construct(public string $filterKey, public FilterPillData $filterPillData) { - $this->shouldWatch = $this->filterPillData->shouldWatchForEvents() ?? 0; + $this->shouldWatch = (bool) $this->filterPillData->shouldWatchForEvents(); } public function render(): null|string|\Illuminate\Support\HtmlString|\Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Contracts\View\View