trait Patchable

Patchable trait for models

Properties

protected array $patchChanges Changes to attributes and relationships

Methods

array
getChanges()

Get changes

void
patch(array $data)

Patch model

verifyModel(array $data)

Verify model based on id if present and type

void
patchAttributes(array $attributes)

Patching the attributes

void
patchSingularRelationships(array $relationships)

Patching singular relationships (BelongsTo, HasOne)

void
patchPluralRelationships(array $relationships)

Patching plural relationships (HasMany, BelongsToMany)

void
resolveRelationsModel(string $id, string $type)

Resolve type and id to a model instance

Details

at line 32
array getChanges()

Get changes

Return Value

array

at line 43
void patch(array $data)

Patch model

Parameters

array $data

Return Value

void

at line 62
protected verifyModel(array $data)

Verify model based on id if present and type

Parameters

array $data

at line 85
protected void patchAttributes(array $attributes)

Patching the attributes

Parameters

array $attributes

Return Value

void

at line 134
protected void patchSingularRelationships(array $relationships)

Patching singular relationships (BelongsTo, HasOne)

Parameters

array $relationships

Return Value

void

at line 178
protected void patchPluralRelationships(array $relationships)

Patching plural relationships (HasMany, BelongsToMany)

Parameters

array $relationships

Return Value

void

at line 242
protected void resolveRelationsModel(string $id, string $type)

Resolve type and id to a model instance

Parameters

string $id
string $type

Return Value

void