Skip to content

Commit

Permalink
updating readme
Browse files Browse the repository at this point in the history
  • Loading branch information
AliBayat authored May 15, 2022
1 parent f0400af commit 1983c41
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,22 @@ $frontendCategory = Category::find(3); // 'FrontEnd'
// return array
```

### Get all posts attached to given category (collection)
### Get all posts attached to given category (MorphToMany)
```php
$categoryPosts = Category::find(1)
->entries(Post::class)
->get();
->entries(Post::class);


// return MorphToMany
```

### Get all posts attached to given category or it's children (Builder)
```php
$categoryAllPosts = Category::find(1)
->allEntries(Post::class);


// return collection
// return Builder
```

---
Expand Down

0 comments on commit 1983c41

Please sign in to comment.