abstract
File
databaseeloquent elationships elationship.php
Package
Default
Class hierarchy
LaravelDatabaseEloquentRelationshipsRelationship

Tags

None found

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

Tags

None found

Methods

__construct()

__construct(\Laravel\Database\Eloquent\Model  $model, string  $associated, string  $foreign) : void

Create a new has one or many association instance.

Parameters

LaravelDatabaseEloquentModel $model
string $associated
string $foreign

Tags

None found

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

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

Tags

None found

foreign_key()

foreign_key() : string

Get the foreign key for the relationship.

Returns

string

Tags

None found

keys()

keys(array  $results) : array

Gather all the primary keys from a result set.

Parameters

array $results

Returns

array

Tags

None found

with()

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

The relationships that should be eagerly loaded by the query.

Parameters

array $includes

Returns

LaravelDatabaseEloquentRelationshipsRelationship

Tags

None found

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

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

Tags

None found