<?php ->filter(fn ($page) => str_starts_with(
Str::slug($page['title'], ' '),
Str::slug($search, ' ')
))->keys()->first() ?? $this->pages()->map(fn ($page) => similar_text(
Str::slug($page['title'], ' '),
Str::slug($search, ' '),
))
->filter(fn ($score) => $score >= min(3, Str::length($search)))
->sortDesc()
->keys()