thetispro / laravel5-setting

Persistent configuration settings for Laravel 5.x with json file(s)
MIT License
26 stars 5 forks source link

Fail using different path #6

Closed JeffeSouza closed 8 years ago

JeffeSouza commented 8 years ago

I'm trying to use a path and a different file, but it only works when I try to write the data, but when I try to read it always picks up the default file. And even when it writes, save only one setting, overlapping the previous configuration.

thetispro commented 8 years ago

if you are using Laravel 5 could you create this simple route

Route::get('setting', function(){ \Setting::path(app_path().'/storage/meta/sub')->set('testPath','a'); \Setting::filename('setting2.json')->set('testFile','b'); \Setting::path(app_path().'/storage/meta/sub')->filename('dummy.json')->set('testPathAndFile','c');

$testPath=\Setting::path(app_path().'/storage/meta/sub')->get('testPath');
$testFile= \Setting::filename('setting2.json')->get('testFile');
$testPathAndFile=\Setting::path(app_path().'/storage/meta/sub')->filename('dummy.json')->get('testPathAndFile');

return $testPath.' '.$testFile.' '.$testPathAndFile;

});

It returns 'a b c' as as announced.

You can also adapt this code for a phpunit test. It still works !

theInscriber commented 7 years ago

Well in my case it does return the test path but they are not written on the sub file.