categories = Category::query() ->where(function ($query) { $query->whereJsonContains('restricted_to', $this->section) ->orWhereNull('restricted_to'); }) ->orderBy('name') ->get(); } /** * Get the view / contents that represent the component. */ public function render(): View|Closure|string { return view('components.category-selector'); } }