βοΈ Configuration Guide
Configuration Overview
ProfileHub provides extensive configuration options to customize the behavior, appearance, and functionality of the user profile management system. Configuration is managed through Laravel's standard configuration files and environment variables.
This guide covers all available configuration options, their purposes, and recommended settings for different use cases.
Configuration Files
π profilehub.php
Main configuration file containing ProfileHub-specific settings, feature toggles, and default values.
Location: config/profilehub.php
π .env Variables
Environment-specific settings that can be configured per deployment without code changes.
Location: .env
π Filesystem Config
File upload and storage configuration integrated with Laravel's filesystem configuration.
Location: config/filesystems.php
π Authentication
User authentication and session management configuration extending Laravel's auth system.
Location: config/auth.php
Main Configuration (profilehub.php)
Core Settings
The main ProfileHub configuration file contains all package-specific settings:
Configuration Options Reference
force_profile_update boolean
Purpose: Controls whether users are forced to complete their profiles before accessing the application.
Default: true
Environment Variable: PROFILEHUB_FORCE_PROFILE_UPDATE
profile_photo_path string
Purpose: Defines the directory path for storing user profile photos.
Default: 'profile-photos'
Environment Variable: PROFILEHUB_PROFILE_PHOTO_PATH
default_avatar string
Purpose: Specifies the default avatar image for users without profile photos.
Default: 'default.png'
Environment Variable: PROFILEHUB_DEFAULT_AVATAR
route_prefix string
Purpose: Sets the URL prefix for all ProfileHub routes.
Default: 'profilehub'
Environment Variable: PROFILEHUB_ROUTE_PREFIX
max_upload_size integer
Purpose: Maximum file upload size in kilobytes for profile photos and documents.
Default: 2048 (2MB)
Environment Variable: PROFILEHUB_MAX_UPLOAD_SIZE
Environment Variables
Environment Configuration (.env)
Configure ProfileHub through environment variables for different deployment environments:
File Upload Configuration
ProfileHub integrates with Laravel's file storage system and requires proper configuration for secure file handling.
Storage Configuration
PHP Configuration
Ensure your PHP configuration supports the file sizes you want to allow:
| PHP Setting | Recommended Value | Purpose |
|---|---|---|
| upload_max_filesize | 10M | Maximum size of uploaded files |
| post_max_size | 10M | Maximum size of POST data |
| max_file_uploads | 20 | Maximum number of files per upload |
| memory_limit | 256M | PHP memory limit |
| max_execution_time | 300 | Script execution timeout |
Security Configuration
π Security Considerations
- File Type Validation: Always validate uploaded file types
- File Size Limits: Implement appropriate file size restrictions
- Storage Location: Store files outside the web root when possible
- Access Control: Implement proper file access permissions
- CSRF Protection: Ensure all forms have CSRF tokens
File Type Restrictions
Performance Configuration
Pagination and Caching
Localization Configuration
Multi-language Support
Email Configuration
Notification Settings
Advanced Configuration
β οΈ Advanced Settings
The following settings should only be modified by experienced developers who understand their implications.
Custom Field Configuration
Configuration Best Practices
β Recommended Practices
- Use environment variables for deployment-specific settings
- Keep sensitive information (API keys, passwords) in .env files
- Configure appropriate file upload limits for your use case
- Enable profile completion enforcement for data quality
- Set up proper backup strategies for configuration files
- Document any custom configuration changes
- Test configuration changes in staging before production
- Monitor storage usage and adjust limits accordingly
π‘ Configuration Tips
- Use different configurations for development, staging, and production
- Implement configuration validation to catch errors early
- Consider using configuration caching for better performance
- Keep configuration files under version control
- Regularly review and update security-related settings