Skip to content

Commit

Permalink
Adds missing logic from Eloquent
Browse files Browse the repository at this point in the history
  • Loading branch information
octoberapp committed Jul 19, 2023
1 parent e4bcab2 commit 35dff96
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Database/Concerns/HasAttributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@ public function attributesToArray()
*/
public function getAttribute($key)
{
if (array_key_exists($key, $this->attributes) || $this->hasGetMutator($key)) {
if (
array_key_exists($key, $this->attributes) ||
$this->hasGetMutator($key) ||
$this->hasAttributeMutator($key) ||
$this->isClassCastable($key)
) {
return $this->getAttributeValue($key);
}

Expand Down

0 comments on commit 35dff96

Please sign in to comment.