This example provides functionality of searching records through multiple relations.
Here is used "whereHas" and "orWhereHas" functionality.
To make search with nested boolean expressions here is used hack with $query->where( here goes whereHas and orWhere)
Example based on package https://github.com/cmgmyr/laravel-messenger