-
Notifications
You must be signed in to change notification settings - Fork 2
Options
Viames Marino edited this page Feb 23, 2026
·
1 revision
Pair\Helpers\Options manages application options stored in database table options.
It is a singleton with typed casting and optional password encryption.
Returns one option value.
Updates one option value in DB and in-memory cache.
Password-type options can be encrypted/decrypted using OPTIONS_CRYPT_KEY from .env.
Helper:
isCryptAvailable(): bool
use Pair\Helpers\Options;
$siteName = Options::get('site_name');
if (Options::exists('smtp_password')) {
Options::set('smtp_password', 'new-secret');
}
$all = Options::getInstance()->getAll();- Missing option names throw
PairExceptionon set. - Option values are cast according to their configured type (
int,bool,password, ...).
See also: Database, Configuration-file, Mailer.