Search
Wirechat includes search paths for finding conversations and selecting users when starting chats, creating groups, adding members, or sharing invite links.
Conversation Search
Enable the chat-list search field from the panel:
use Wirechat\Wirechat\Panel;
public function panel(Panel $panel): Panel
{
return $panel
->chatsSearch();
}
Disable it by passing false:
->chatsSearch(false)
See Panels for the full panel option.
User Search
User search uses your application's user model. Configure searchable attributes when the default query is enough:
->searchableAttributes(['name', 'email', 'username'])
Use a custom callback when the application needs its own eligibility rules:
->searchUsersUsing(function (string $needle) {
return User::query()
->where('name', 'like', "%{$needle}%")
->limit(20)
->get();
})
See Users for user search customization.
Encrypted Messages
Wirechat does not provide message body search. When message encryption is enabled, stored message bodies cannot be queried with database LIKE searches.
Use a separate indexing strategy for custom message search. See Encryption.