Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 86fd1db

Browse files
EloProfEloProf
authored andcommitted
Overwrite models getAttributes() to include all attachments
1 parent aad0e0d commit 86fd1db

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/ORM/EloquentTrait.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,14 @@ public function setAttribute($key, $value)
109109

110110
parent::setAttribute($key, $value);
111111
}
112+
113+
/**
114+
* Get all of the current attributes and attachment objects on the model.
115+
*
116+
* @return mixed
117+
*/
118+
public function getAttributes()
119+
{
120+
return array_merge($this->attachedFiles, parent::getAttributes());
121+
}
112122
}

0 commit comments

Comments
 (0)