Order global search results like $navigationSort enables ordering in the navbar #5618
Replies: 2 comments 4 replies
-
P.S. Is there also a possibility to limit of search results returned? This code does not have any effect. protected static function getGlobalSearchEloquentQuery(): Builder
{
return parent::getGlobalSearchEloquentQuery()
->limit(2);
} |
Beta Was this translation helpful? Give feedback.
2 replies
-
You can reach that with an eloquent query: https://filamentphp.com/docs/2.x/admin/resources/global-search#details protected static function getGlobalSearchEloquentQuery(): Builder
{
return parent::getGlobalSearchEloquentQuery()->orderBy('column', 'sort');
} |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all, Great Package!
Ordering items in the navbar is possible by setting the variable
$navigationSort
.Can you also specify this order by a different method for the global search results?
Beta Was this translation helpful? Give feedback.
All reactions