Skip to content

Commit

Permalink
FIX: Duplicated keys when using doted keys #40 (#41)
Browse files Browse the repository at this point in the history
* FIX: Duplicated keys in when using doted keys #40
  • Loading branch information
chadidi authored and glorand committed Dec 20, 2019
1 parent 6c02732 commit 880aedf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to `glorand/laravel-model-settings` will be documented in this file

## 3.5.4 - 2019-12-20
### Fix
- https://github.com/glorand/laravel-model-settings/issues/40

## 3.5.3 - 2019-12-11
### Fix
- https://github.com/glorand/laravel-model-settings/issues/36
Expand Down
7 changes: 6 additions & 1 deletion src/Managers/AbstractSettingsManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ public function __construct(Model $model)
*/
public function all(): array
{
return array_merge($this->model->getDefaultSettings(), $this->model->getSettingsValue());
$array = [];
foreach (array_merge($this->model->getDefaultSettings(), $this->model->getSettingsValue()) as $key => $value) {
Arr::set($array, $key, $value);
}

return $array;
}

/**
Expand Down

0 comments on commit 880aedf

Please sign in to comment.