Closed manojrhr closed 5 years ago
same for me
@Venrir can you share how you've set it up, and the code that sets and saves?
config/settings.php
Change:
'store' => 'json'
To
'store' => 'database'
I'm having this same issue, the ::set() method does nothing, just returns null
::get() works perfectly fine, retrieving from the database as expected
Make sure to run php artisan config:cache
after changing config file.
Still not working for Lara 8
config/settings.php
exists, 'store' => 'database'
settings table also exists
Run php artisan config:cache
several times
ddd(setting()->set('test', 'value'))
returns NULL
ddd(setting(['test' => 'value']))
returns a different result ( why?)
anlutro\LaravelSettings\DatabaseSettingStore {#203 ▼
#connection: Illuminate\Database\MySqlConnection {#200 ▶}
#table: "settings"
#keyColumn: "key"
#valueColumn: "value"
#queryConstraint: null
#extraColumns: []
#data: array:1 [▶]
#updatedData: array:1 [▶]
#persistedData: []
#unsaved: true
#loaded: true
#defaults: array:1 [▶]
#cache: null
#cacheTtl: 15
#cacheForgetOnWrite: true
}
@sribna setting()
called with an array will set the configuration and then return the result. When you call set
on the store it will not. set
is correct to be void.
SettingStore::set()
: https://github.com/anlutro/laravel-settings/blob/6029f6aeb84fe74cdfb0c0152e69576033fb665f/src/SettingStore.php#L148
I have installed this repo to my laravel 5.6.12 and write this code
But my I didn't get anything in my settings table. Is there any thing I am missing?