I have a model Project,
The model has the relationship belongsTo User. (The creator of the project)
But also has another relationship hasMany User. (The creator can invite other users to the project)
So I want to make a query to return all projects that the auth user create and also the ones that the auth has been invited.
public function scopeSearch($query, $search)
{
$query->where('user_id', auth()->id());
// $query->{ also the ones that auth()->id() has been invited}
}