/** * @param array $schema */ protected static function prepareConfigSchemaField(array &$schema) { parent::prepareConfigSchemaField($schema); switch ($schema['name']) { case 'cache_enabled': $schema['label'] = 'Data Retrieval Caching Enabled'; $schema['description'] = 'Enable caching of GET requests particularly for this service.' . ' Only GET requests without payload are cached.'; break; case 'cache_ttl': $schema['label'] = 'Cache Time To Live (minutes)'; $schema['description'] = 'The amount of time each cached response is allowed to last.' . ' Once expired, a new request to the service is made.'; break; } }
public static function boot() { parent::boot(); static::created(function (CloudEmailConfig $emailConfig) { if (!empty($emailConfig->parameters)) { $params = []; foreach ($emailConfig->parameters as $param) { $params[] = new EmailServiceParameterConfig($param); } $emailConfig->parameter()->saveMany($params); } return true; }); }
/** * {@inheritdoc} */ public static function getConfigSchema() { $schema = ['name' => 'parameters', 'label' => 'Parameters', 'description' => 'Supply additional parameters to be replace in the email body.', 'type' => 'array', 'required' => false, 'allow_null' => true]; $schema['items'] = parent::getConfigSchema(); return [$schema]; }