Setting Module
The setting module comes with the following hooks. You can hook into those using the usual listener logic.
These methods are available:
getSettingName()
: will return the setting namegetSettingValues()
: will return the setting value(s)setSettingValues($settingValues)
: set the value for the current settinggetOriginal()
: get the original setting valuesThe SettingIsUpdating
has one more method:
getSetting()
: Will return the setting being updatedTo keep the example simple we're going to use an inline listener using a closure instead of a full class.
Lets say we want to uppercase our core::template
setting:
Event::listen(SettingIsCreating::class, function (SettingIsCreating $event) {
if ($event->getSettingName() === 'core::template') {
$event->setSettingValues('my-template');
}
});