Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions src/db/src/Concern/HasAttributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function getModelAttributesValue(): array
*/
public function getArrayableAttributes(): array
{
return array_merge($this->modelAttributes, $this->getModelAttributes());
return array_merge($this->getModelAttributes(), $this->modelAttributes);
}

/**
Expand Down Expand Up @@ -186,7 +186,7 @@ public function hasGetter(string $key): bool
* Get the value of an attribute using its mutator.
*
* @param string $key
* @param mixed $value
* @param mixed $value
*
* @return mixed
*/
Expand Down Expand Up @@ -242,7 +242,7 @@ public function hasSetter($key): bool
* Set the value of an attribute using its mutator.
*
* @param string $key
* @param mixed $value
* @param mixed $value
*
* @return mixed
*/
Expand All @@ -258,7 +258,7 @@ protected function setMutatedAttributeValue($key, $value)
* Set a given JSON attribute on the model.
*
* @param string $key
* @param mixed $value
* @param mixed $value
*
* @return $this
*/
Expand All @@ -278,7 +278,7 @@ public function fillJsonAttribute($key, $value): self
*
* @param string $path
* @param string $key
* @param mixed $value
* @param mixed $value
*
* @return array
*/
Expand Down Expand Up @@ -321,7 +321,7 @@ protected function asJson($value, int $option = JSON_UNESCAPED_UNICODE): string
* Decode the given JSON back into an array or object.
*
* @param string $value
* @param bool $asObject
* @param bool $asObject
*
* @return mixed
*/
Expand Down Expand Up @@ -390,7 +390,7 @@ public function getModelAttributes(): array
* Set the array of model attributes. No checking is done.
*
* @param array $attributes
* @param bool $sync
* @param bool $sync
*
* @return $this
* @throws DbException
Expand All @@ -417,7 +417,7 @@ public function setRawAttributes(array $attributes, bool $sync = false): self
* Get safe model attributes
*
* @param array $attributes
* @param bool $encode
* @param bool $encode
*
* @return array
*/
Expand Down Expand Up @@ -478,7 +478,7 @@ protected function isJsonSelector(string $value): bool
* Get the model's original attribute values.
*
* @param string|null $key
* @param mixed $default
* @param mixed $default
*
* @return mixed|array
*/
Expand Down Expand Up @@ -606,7 +606,7 @@ public function wasChanged($attributes = null): bool
/**
* Determine if the given attributes were changed.
*
* @param array $changes
* @param array $changes
* @param array|string|null $attributes
*
* @return bool
Expand Down Expand Up @@ -660,7 +660,7 @@ public function getDirty(): array
* Determine if the new and old values for a given key are equivalent.
*
* @param string $key
* @param mixed $current
* @param mixed $current
*
* @return bool
*/
Expand All @@ -670,7 +670,7 @@ protected function originalIsEquivalent(string $key, $current): bool
return false;
}

$original = $this->getModelOriginal($key);
$original = $this->getModelAttribute($key);

if ($current === $original) {
return true;
Expand Down