Queryable
trait Queryable
Properties
protected string | $defaultOrderByField | Determines the default field to order the query by | |
protected string | $defaultSortDirection | Determines the default direction to order the query by |
Methods
No description
Determine if this object respects publishing statuses when performing queries
Override the publishing status for the model
Adds a field that should be retrieved
Sets which fields to retrieve (default: All fields)
Limits the results to $limit amount of hits
Sets the field which to order the results by
Performs a raw query, use carefully.
Performs a 'publishedAt' query
Performs a 'where' query
Queries where field exists in the values
Performs a 'whereNot' query
No description
No description
Creates a paginated result
Perform an action and mutate the given key if $shouldCache is true
Cache the results with the given key if $shouldCache is true
Cache the results with the given key
Get the count of items matching the current query
No description
Details
at line 39
static protected Builder
makeQueryBuilder($appends = [])
at line 99
bool
respectPublishingStatus()
Determine if this object respects publishing statuses when performing queries
at line 111
static Builder
disregardingPublishingStatus(bool $disregarding = true)
Override the publishing status for the model
at line 125
static Builder
field(...$args)
Adds a field that should be retrieved
at line 138
static Builder
fields(...$args)
Sets which fields to retrieve (default: All fields)
at line 151
static Builder
limit(...$args)
Limits the results to $limit amount of hits
at line 166
static Builder
orderBy(...$args)
Sets the field which to order the results by
at line 179
static Builder
raw(...$args)
Performs a raw query, use carefully.
at line 192
static Builder
publishedAt(...$args)
Performs a 'publishedAt' query
at line 210
static Builder
where(...$args)
Performs a 'where' query
If a closure is passed as the only argument, a new query scope will be created. If $value is omitted, $operator is used as the $value, and the $operator will be set to '='.
at line 224
static Builder
whereIn(...$args)
Queries where field exists in the values
at line 242
static Builder
whereNot(...$args)
Performs a 'whereNot' query
If a closure is passed as the only argument, a new query scope will be created. If $value is omitted, $operator is used as the $value, and the $operator will be set to '='.
at line 257
static
whereBetween(...$args)
at line 272
static
whereNotBetween(...$args)
at line 287
static Paginator
paginate(...$args)
Creates a paginated result
at line 303
static mixed
maybeMutatesCache(string $key, bool $shouldCache, Closure $action)
Perform an action and mutate the given key if $shouldCache is true
at line 320
static Builder
maybeCacheResults(string $key, bool $shouldCache)
Cache the results with the given key if $shouldCache is true
at line 336
static Builder
cacheResults(string $key)
Cache the results with the given key
at line 349
static int
count(...$args)
Get the count of items matching the current query
at line 360
static Queryable|Collection
random(int $amount = 1)
Picks random items