Configuration
Data Helpers works out of the box with zero configuration, but you can customize its behavior for your specific needs.
Laravel Configuration
Section titled “Laravel Configuration”Data Helpers automatically registers its service provider in Laravel. No configuration is required.
Publishing Configuration
Section titled “Publishing Configuration”You can publish the configuration file:
php artisan vendor:publish --tag=data-helpers-configThis creates config/data-helpers.php:
return [ 'performance_mode' => env('DATA_HELPERS_PERFORMANCE_MODE', false), 'cache_enabled' => env('DATA_HELPERS_CACHE_ENABLED', true),];Symfony Configuration
Section titled “Symfony Configuration”Data Helpers automatically registers its bundle in Symfony. No configuration is required.
Bundle Configuration
Section titled “Bundle Configuration”Create config/packages/data_helpers.yaml:
data_helpers: performance_mode: '%env(bool:DATA_HELPERS_PERFORMANCE_MODE)%' cache_enabled: '%env(bool:DATA_HELPERS_CACHE_ENABLED)%'Plain PHP Configuration
Section titled “Plain PHP Configuration”For plain PHP projects, use the ConfigLoader to load and merge configuration:
use event4u\DataHelpers\Config\ConfigLoader;use event4u\DataHelpers\DataHelpersConfig;
// Load config with deep merging$config = ConfigLoader::load(__DIR__ . '/config/data-helpers.php');DataHelpersConfig::initialize($config);The ConfigLoader performs deep merging - you only need to specify values you want to change. All other values use package defaults.
See ConfigLoader for detailed documentation.
Programmatic Configuration
Section titled “Programmatic Configuration”You can also configure Data Helpers programmatically:
use event4u\DataHelpers\DataHelpersConfig;
DataHelpersConfig::set('performance_mode', 'fast');DataHelpersConfig::set('cache.max_entries', 1000);Configuration Options
Section titled “Configuration Options”Performance Mode
Section titled “Performance Mode”Enable performance mode for production environments:
use event4u\DataHelpers\DataHelpersConfig;
DataHelpersConfig::set('performance_mode', 'fast');// Options: 'fast' or 'safe'This disables debug features and enables optimizations.
Configure caching:
use event4u\DataHelpers\DataHelpersConfig;
DataHelpersConfig::set('cache.max_entries', 1000);DataHelpersConfig::set('cache.default_ttl', 3600);Caching improves performance for repeated operations.
Environment Variables
Section titled “Environment Variables”You can use environment variables to configure Data Helpers:
DATA_HELPERS_PERFORMANCE_MODE=trueDATA_HELPERS_CACHE_ENABLED=trueNext Steps
Section titled “Next Steps”- Core Concepts - Learn the fundamentals
- Quick Start - Get started in 5 minutes
- Performance - Optimize for production