Closed K4q4m3 closed 5 years ago
Not from config file at the moment, but this is how you do it within your app's AppServiceProvider::boot()
method:
//use Konekt\Gears\Defaults\SimpleSetting;
// Register the setting:
$this->app->get('gears.settings_registry')
->add(new SimpleSetting('app.worklogs.hours_per_day', 6));
// Add the setting to the AppShell UI
$this->app->get('appshell.settings_tree_builder')
->addRootNode('app', 'Application', 110) // the id/label of the tab
->addChildNode('app', 'app_worklogs', 'Worklogs') // the id/label of the group within the tab
->addSettingItem('app_worklogs', ['text', ['label' => 'Hours Per Day']], 'app.worklogs.hours_per_day'); // The setting field itself
The Settings part is built with the gears library, for in-depth details it may worth to take a look at: https://artkonekt.github.io/gears/
Also feel free to send a follow up here.
Please reopen if it doesn't work as expected.
Is it possible to add extra settings fields from config file?
https://github.com/artkonekt/appshell/blob/9cf5222a05b183432fa9c2bd7a3905eb177e8cd9/src/Providers/ModuleServiceProvider.php#L279-L282