trait HasBuilder (View source)

Methods

static TBuilder
query()

Begin querying the model.

TBuilder
newEloquentBuilder(Builder $query)

Create a new Eloquent query builder for the model.

TBuilder
newQuery()

Get a new query builder for the model's table.

TBuilder
newModelQuery()

Get a new query builder that doesn't have any global scopes or eager loading.

TBuilder
newQueryWithoutRelationships()

Get a new query builder with no relationships loaded.

TBuilder
newQueryWithoutScopes()

Get a new query builder that doesn't have any global scopes.

TBuilder
newQueryWithoutScope(Scope|string $scope)

Get a new query instance without a given scope.

TBuilder
newQueryForRestoration(array|int $ids)

Get a new query to restore one or more models by their queueable IDs.

static TBuilder
on(string|null $connection = null)

Begin querying the model on a given connection.

static TBuilder
onWriteConnection()

Begin querying the model on the write connection.

static TBuilder
with(array|string $relations)

Begin querying a model with eager loading.

Details

static TBuilder query()

Begin querying the model.

Return Value

TBuilder

TBuilder newEloquentBuilder(Builder $query)

Create a new Eloquent query builder for the model.

Parameters

Builder $query

Return Value

TBuilder

TBuilder newQuery()

Get a new query builder for the model's table.

Return Value

TBuilder

TBuilder newModelQuery()

Get a new query builder that doesn't have any global scopes or eager loading.

Return Value

TBuilder

TBuilder newQueryWithoutRelationships()

Get a new query builder with no relationships loaded.

Return Value

TBuilder

TBuilder newQueryWithoutScopes()

Get a new query builder that doesn't have any global scopes.

Return Value

TBuilder

TBuilder newQueryWithoutScope(Scope|string $scope)

Get a new query instance without a given scope.

Parameters

Scope|string $scope

Return Value

TBuilder

TBuilder newQueryForRestoration(array|int $ids)

Get a new query to restore one or more models by their queueable IDs.

Parameters

array|int $ids

Return Value

TBuilder

static TBuilder on(string|null $connection = null)

Begin querying the model on a given connection.

Parameters

string|null $connection

Return Value

TBuilder

static TBuilder onWriteConnection()

Begin querying the model on the write connection.

Return Value

TBuilder

static TBuilder with(array|string $relations)

Begin querying a model with eager loading.

Parameters

array|string $relations

Return Value

TBuilder

Laravel Cloud is the best place to deploy Laravel, Nuxt, Express, Hono, Node.js, Bun, Go, Flask, Python, and more, with dedicated infrastructure available on AWS through Laravel Private Cloud.