Closed arifhossen-dev closed 2 years ago
class User extends Authenticatable implements MessengerProvider
use Messageable;
public static function getProviderSettings(): array { return [ 'alias' => 'user', 'searchable' => true, 'friendable' => true, 'devices' => true, 'default_avatar' => public_path('vendor/messenger/images/users.png'), 'cant_message_first' => [], 'cant_search' => [], 'cant_friend' => [], ]; }
public static function getProviderSearchableBuilder( Builder $query, string $search, array $searchItems ) { $query->where(function (Builder $query) use ($searchItems) { foreach ($searchItems as $item) { $query->orWhere('name', 'LIKE', "%{$item}%"); } })->orWhere('email', '=', $search); }
I am using BIGINT id in the users table
BIGINT
Please do not cross-post issues. This issue was handled:
https://github.com/RTippin/messenger/issues/40
1. How can a user search all users (including new fresh users) for conversations?
In the users table
Getting only logged in user
I want to get search results from all new users. Logged in or not.
in user model
Implements
Using traite
Setting method
Searchable method
2. How can users add participants in a group without being friends?
I am using
BIGINT
id in the users table