Skip to content

Commit 3e3394e

Browse files
authored
Merge pull request #1 from bionicmaster/5.5-fix-mutable
5.5 fix mutable
2 parents cc2c8e5 + 47598cf commit 3e3394e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Mutable.php

+8
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ trait Mutable
2828
*/
2929
public static function bootMutable()
3030
{
31+
if (!isset(static::$attributeMutator)) {
32+
if (function_exists('app') && app()->bound('eloquence.mutator')) {
33+
static::setAttributeMutator(app('eloquence.mutator'));
34+
} else {
35+
static::setAttributeMutator(new Mutator);
36+
}
37+
}
38+
3139
$hooks = new Hooks;
3240

3341
foreach (['setAttribute', 'getAttribute', 'toArray'] as $method) {

0 commit comments

Comments
 (0)