telegram-bot-essentials/settings

Per-bot typed key/value settings for telegram-bot-essentials/essence
1,099
Install
composer require telegram-bot-essentials/settings
Latest Version:v0.0.25
PHP:^8.3
Laravel:12 · 13
License:MIT
Last Updated:Oct 12, 2026
Links: GitHub  ·  Packagist
Maintainer: Elyar0

Telegram Bot Essentials — Settings

Latest Version tests License: MIT

A per-bot, typed key/value settings system for the telegram-bot-essentials/essence bot framework. Every other package in the ecosystem — Billing, User Wallet, Affiliates, the gateways — registers its configurable options through this package instead of inventing its own storage, and admins get a generated settings menu for free.

Installation

composer require telegram-bot-essentials/settings
php artisan migrate

A locale setting is registered out of the box, letting each bot pick its own admin/reply language independently.

Usage

Declare a setting once, in a service provider's boot():

use TelegramBotEssentials\Settings\DTOs\Setting;
use TelegramBotEssentials\Settings\Enums\SettingType;

settings()->addSetting(new Setting(
    key: 'billing.user_wallet.status',
    label: fn () => __('my-package::settings.wallet_status.label'),
    type: SettingType::CHECKBOX,
    default: false,
));

Then read and write it through the settings() helper — always scoped to the current bot:

settings()->get('billing.user_wallet.status');       // falls back to the declared default
settings()->set('billing.user_wallet.status', true); // validated against the type before saving

SettingType covers TEXT, NUMBER, CHECKBOX, SENSITIVE (encrypted at rest), SELECT / ENUM / MULTISELECT, and DIRECTORY (UI grouping). beforeSet / afterSet hooks and additive Laravel validation rules are available per setting.

Evaluate lazily. Settings are per-bot and boot() runs once per application, so never resolve settings()->get(...) directly in boot() to decide whether to register something — wrap the check in a Closure that runs at request time.

The package also ships a channel_lock setting group that gates every action behind membership in a Telegram channel.

Documentation

Full documentation, including the Setting DTO reference, locale switching, and the channel-lock flow, lives on the Telegram Bot Essentials documentation site under Modules → Settings.

License

MIT.

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

644,549,754 9,698
laravel/framework

The Laravel Framework.

598,760,099 34,966
laravel/tinker

Powerful REPL for the Laravel framework.

507,193,856 7,441
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

423,477,751 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

403,217,078 4,664

Version History

Version Released PHP Laravel License
v0.0.25 ^8.3 ^12 || ^13 MIT
v0.0.24 ^8.3 ^12 || ^13 MIT
v0.0.23 ^8.3 ^12 || ^13 MIT
v0.0.22 ^8.3 ^12 || ^13 MIT
v0.0.21 ^8.3 ^12 || ^13 MIT