keyCode === 'cdn.bunny.api_key') { * // API key changed - refresh CDN client * $this->cdnService->refreshClient(); * } * * // Check for prefix matches * if (str_starts_with($event->keyCode, 'mymodule.')) { * Cache::tags(['mymodule'])->flush(); * } * } * } * ``` * * ## In Module Boot.php * * ```php * use Core\Config\Events\ConfigChanged; * * class Boot * { * public static array $listens = [ * ConfigChanged::class => 'onConfigChanged', * ]; * * public function onConfigChanged(ConfigChanged $event): void * { * // Handle config changes * } * } * ``` * * @see ConfigInvalidated For cache invalidation events * @see ConfigLocked For when config values are locked */ class ConfigChanged { use Dispatchable; use InteractsWithSockets; use SerializesModels; public function __construct( public readonly string $keyCode, public readonly mixed $value, public readonly mixed $previousValue, public readonly ConfigProfile $profile, public readonly ?int $channelId = null, ) {} }