class DiscussionRepository

Methods

query()

Get a new query builder for the discussions table.

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

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

getReadIds( User $user) deprecated

Get the IDs of discussions which a user has read completely.

getReadIdsQuery( User $user)

Get a query containing the IDs of discussions which a user has read completely.

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

Scope a query to only include records that are visible to a user.

Details

Discussion> query()

Get a new query builder for the discussions table.

Return Value

Discussion>

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

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

Parameters

int|string $id
User $user

Return Value

Discussion

Discussion> getReadIds( User $user) deprecated

deprecated 1.3 Use `getReadIdsQuery` instead

Get the IDs of discussions which a user has read completely.

Parameters

User $user

Return Value

Discussion>

Builder getReadIdsQuery( User $user)

Get a query containing the IDs of discussions which a user has read completely.

Parameters

User $user

Return Value

Builder

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

Scope a query to only include records that are visible to a user.

Parameters

Builder $query
User $user

Return Value

Discussion>