class PostRepository
Methods
<p>Find a post by ID, optionally making sure it is visible to a certain user, or throw an exception.</p>
<p>Filter a list of post IDs to only include posts that are visible to a certain user.</p>
<p>Get the position within a discussion where a post with a certain number is. If the post with that number does not exist, the index of the closest post to it will be returned.</p>
Details
at
line 22
Builder
query()
at
line 30
Builder
queryVisibleTo(User|null $user = null)
at
line 47
Post
findOrFail(int $id, User|null $actor = null)
<p>Find a post by ID, optionally making sure it is visible to a certain user, or throw an exception.</p>
at
line 56
Collection
findWhere(array $where = [], User $actor = null, array $sort = [], int $count = null, int $start = 0)
<p>Find posts that match certain conditions, optionally making sure they are visible to a certain user, and/or using other criteria.</p>
at
line 76
array
filterVisibleIds(array $ids, User $actor)
<p>Filter a list of post IDs to only include posts that are visible to a certain user.</p>
at
line 86
int
getIndexForNumber(int $discussionId, int $number, User|null $actor = null)
<p>Get the position within a discussion where a post with a certain number is. If the post with that number does not exist, the index of the closest post to it will be returned.</p>