trait BelongsToModel (View source)

Properties

protected Model|string|Closure|null $model
protected Closure|null $loadStateFromRelationshipsUsing
protected Closure|null $saveRelationshipsUsing
protected Closure|null $saveRelationshipsBeforeChildrenUsing
protected bool|Closure $shouldSaveRelationshipsWhenDisabled
protected bool|Closure $shouldSaveRelationshipsWhenHidden

Methods

model(Model|string|Closure|null $model = null)

No description

void
saveRelationships()

No description

void
void
loadStateFromRelationships(bool $andHydrate = false)

No description

saveRelationshipsUsing(Closure|null $callback)

No description

saveRelationshipsWhenDisabled(bool|Closure $condition = true)

No description

bool
saveRelationshipsWhenHidden(bool|Closure $condition = true)

No description

bool
loadStateFromRelationshipsUsing(Closure|null $callback)

No description

string|null
getModel()

No description

Model|null
getRecord()

No description

Model|null
getModelInstance()

No description

Details

BelongsToModel model(Model|string|Closure|null $model = null)

No description

Parameters

Model|string|Closure|null $model

Return Value

BelongsToModel

void saveRelationships()

No description

Return Value

void

void saveRelationshipsBeforeChildren()

No description

Return Value

void

void loadStateFromRelationships(bool $andHydrate = false)

No description

Parameters

bool $andHydrate

Return Value

void

BelongsToModel saveRelationshipsUsing(Closure|null $callback)

No description

Parameters

Closure|null $callback

Return Value

BelongsToModel

BelongsToModel saveRelationshipsBeforeChildrenUsing(Closure|null $callback)

No description

Parameters

Closure|null $callback

Return Value

BelongsToModel

BelongsToModel saveRelationshipsWhenDisabled(bool|Closure $condition = true)

No description

Parameters

bool|Closure $condition

Return Value

BelongsToModel

bool shouldSaveRelationshipsWhenDisabled()

No description

Return Value

bool

BelongsToModel saveRelationshipsWhenHidden(bool|Closure $condition = true)

No description

Parameters

bool|Closure $condition

Return Value

BelongsToModel

bool shouldSaveRelationshipsWhenHidden()

No description

Return Value

bool

BelongsToModel loadStateFromRelationshipsUsing(Closure|null $callback)

No description

Parameters

Closure|null $callback

Return Value

BelongsToModel

string|null getModel()

No description

Return Value

string|null

Model|null getRecord()

No description

Return Value

Model|null

Model|null getModelInstance()

No description

Return Value

Model|null