class DiscussionRepository

Methods

Discussion>
query()

<p>Get a new query builder for the discussions table.</p>

findOrFail(int|string $id, User $user = null)

<p>Find a discussion by ID, optionally making sure it is visible to a certain user, or throw an exception.</p>

Discussion>
getReadIds(User $user) deprecated

<p>Get the IDs of discussions which a user has read completely.</p>

Builder
getReadIdsQuery(User $user)

<p>Get a query containing the IDs of discussions which a user has read completely.</p>

Discussion>
scopeVisibleTo(Builder $query, User $user = null)

<p>Scope a query to only include records that are visible to a user.</p>

Details

Discussion> query()

<p>Get a new query builder for the discussions table.</p>

Return Value

Discussion>

Discussion findOrFail(int|string $id, User $user = null)

<p>Find a discussion by ID, optionally making sure it is visible to a certain user, or throw an exception.</p>

Parameters

int|string $id
User $user

Return Value

Discussion

Discussion> getReadIds(User $user) deprecated

deprecated 1.3 Use `getReadIdsQuery` instead

<p>Get the IDs of discussions which a user has read completely.</p>

Parameters

User $user

Return Value

Discussion>

Builder getReadIdsQuery(User $user)

<p>Get a query containing the IDs of discussions which a user has read completely.</p>

Parameters

User $user

Return Value

Builder

protected Discussion> scopeVisibleTo(Builder $query, User $user = null)

<p>Scope a query to only include records that are visible to a user.</p>

Parameters

Builder $query
User $user

Return Value

Discussion>