Skip to content

Commit fd9f3de

Browse files
committed
update Model::has() and Model::hasNo() with where condition
1 parent 75da448 commit fd9f3de

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

v5/relationships.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,4 +351,13 @@ ExampleModel::new()->has('publishedBlog', function(Blog $query) {
351351
$query->where("{$table}.post_status", 'draft');
352352
});
353353
})->get();
354+
```
355+
356+
Further, you can define the existence where condition as `OR`:
357+
358+
```php
359+
ExampleModel::new()
360+
->where('name', 'kevin')
361+
->has('tags', null, 'OR')
362+
->get();
354363
```

0 commit comments

Comments
 (0)