Hey folks, is there some cool Eloquent method to query, let's say, Dogs where Owner's ID is equal 3 or barked_at IS NULL? Silly example, but I'd like to understand how to query for relationship in a fancy way.
I can't use User::find(3)->dogs(), since I also want all dogs that have barked_at IS NULL.
I did this:
$dogs = Dog::whereNull('barked_at')
->orWhereRelation('owners', (new User())->getKeyName(), 3)
->get();
Is there any nicer way instead of using orWhereRelation in combination with (new User())->getKeyName() in my case?