Properties

$model

$model : \Laravel\Database\Eloquent\Model

The model instance being queried.

Type

LaravelDatabaseEloquentModel

Inherited from
LaravelDatabaseEloquentQuery

Tags

None found

$table

$table : \Laravel\Database\Eloquent\Query

The fluent query builder for the query instance.

Type

LaravelDatabaseEloquentQuery

Inherited from
LaravelDatabaseEloquentQuery

Tags

None found

$includes

$includes : array

The relationships that should be eagerly loaded by the query.

Type

array

Inherited from
LaravelDatabaseEloquentQuery

Tags

None found

$passthru

$passthru : array

The methods that should be returned from the fluent query builder.

Type

array

Inherited from
LaravelDatabaseEloquentQuery

Tags

None found

$base

$base : \Laravel\Database\Eloquent\Model

The base model for the relationship.

Type

LaravelDatabaseEloquentModel

Methods

__construct()

__construct(\Laravel\Database\Eloquent\Model  $model) : void

Creat a new query instance for a model.

Parameters

LaravelDatabaseEloquentModel $model

Inherited from
LaravelDatabaseEloquentQuery

Tags

None found

foreign()

foreign(string  $model, string  $foreign = null) : string

Get the foreign key name for the given model.

Parameters

string $model
string $foreign

Returns

string

static
Inherited from
LaravelDatabaseEloquentRelationshipsRelationship

Tags

None found

foreign_key()

foreign_key() : string

Get the foreign key for the relationship.

Returns

string

keys()

keys(array  $results) : array

Gather all the primary keys from a result set.

Parameters

array $results

Returns

array

with()

with(array  $includes) : \Laravel\Database\Eloquent\Relationships\Relationship

The relationships that should be eagerly loaded by the query.

Parameters

array $includes

Returns

LaravelDatabaseEloquentRelationshipsRelationship

find()

find(mixed  $id, array  $columns = array('*')) : mixed

Find a model by its primary key.

Parameters

mixed $id
array $columns

Returns

mixed

Inherited from
LaravelDatabaseEloquentQuery

Tags

None found

first()

first(array  $columns = array('*')) : mixed

Get the first model result for the query.

Parameters

array $columns

Returns

mixed

Inherited from
LaravelDatabaseEloquentQuery

Tags

None found

get()

get(array  $columns = array('*')) : array

Get all of the model results for the query.

Parameters

array $columns

Returns

array

Inherited from
LaravelDatabaseEloquentQuery

Tags

None found

paginate()

paginate(integer  $per_page = null, array  $columns = array('*')) : \Laravel\Database\Eloquent\Paginator

Get an array of paginated model results.

Parameters

integer $per_page
array $columns

Returns

LaravelDatabaseEloquentPaginator

Inherited from
LaravelDatabaseEloquentQuery

Tags

None found

hydrate()

hydrate(\Laravel\Database\Eloquent\Model  $model, array  $results) : array

Hydrate an array of models from the given results.

Parameters

LaravelDatabaseEloquentModel $model
array $results

Returns

array

Inherited from
LaravelDatabaseEloquentQuery

Tags

None found

connection()

connection() : \Laravel\Database\Eloquent\Connection

Get the database connection for the model.

Returns

LaravelDatabaseEloquentConnection

Inherited from
LaravelDatabaseEloquentQuery

Tags

None found

__call()

__call(string  $method, array  $parameters) : mixed

Handle dynamic method calls to the query.

Parameters

string $method
array $parameters

Returns

mixed

Inherited from
LaravelDatabaseEloquentQuery

Tags

None found

insert()

insert(\Laravel\Database\Eloquent\Model|array  $attributes) : \Laravel\Database\Eloquent\Model|false

Insert a new record for the association.

If save is successful, the model will be returned, otherwise false.

Parameters

LaravelDatabaseEloquentModel|array $attributes

Returns

LaravelDatabaseEloquentModel|false

Tags

None found

update()

update(array  $attributes) : boolean

Update a record for the association.

Parameters

array $attributes

Returns

boolean

Tags

None found

eagerly_constrain()

eagerly_constrain(array  $results) : void

Set the proper constraints on the relationship table for an eager load.

Parameters

array $results

Tags

None found

fresh_model()

fresh_model(array  $attributes = array()) : \Laravel\Database\Eloquent\Model

Get a freshly instantiated instance of the related model class.

Parameters

array $attributes

Returns

LaravelDatabaseEloquentModel

load()

load(array  $results, string  $relationship, array|null  $constraints) : void

Hydrate an eagerly loaded relationship on the model results.

Parameters

array $results
string $relationship
array|null $constraints

Inherited from
LaravelDatabaseEloquentQuery

Tags

None found

nested_includes()

nested_includes(string  $relationship) : array

Gather the nested includes for a given relationship.

Parameters

string $relationship

Returns

array

Inherited from
LaravelDatabaseEloquentQuery

Tags

None found

model_includes()

model_includes() : array

Get the eagerly loaded relationships for the model.

Returns

array

Inherited from
LaravelDatabaseEloquentQuery

Tags

None found

table()

table() : \Laravel\Database\Eloquent\Query

Get a fluent query builder for the model.

Returns

LaravelDatabaseEloquentQuery

Inherited from
LaravelDatabaseEloquentQuery

Tags

None found

constrain()

constrain() : void

Set the proper constraints on the relationship table.

Tags

None found