anlutro / laravel-settings

Persistent settings in Laravel
MIT License
940 stars 112 forks source link

Fix incorrect retrieval of keys anlutro/laravel-settings#165 #166

Closed m-safwan closed 2 years ago

m-safwan commented 2 years ago

Fix retrieval of incorrect keys when numeric keys are stored and fetched using SettingsStore::all(). Usage of array_merge in SettingsStore::load() causes the numeric keys in the resultant array to be renumbered. Using + operator to merge two arrays with numeric keys should be a safer option.

Tests:

Testing started at 4:53 pm ...
PHPUnit 8.5.30 #StandWithUkraine

Time: 164 ms, Memory: 10.00 MB

OK (65 tests, 117 assertions)
Process finished with exit code 0