v1.3.1
What's New
Safe Configuration Helper
Added safe_db_config() - a fault-tolerant wrapper for accessing database configuration values with built-in exception handling.
Key Features:
- Graceful Error Handling: Catches all exceptions (database connection errors, missing tables, serialization issues) and returns the default value instead of crashing
- Perfect for Critical Paths: Use it in service providers, middleware, bootstrapping phases, or anywhere database availability isn't guaranteed
- Zero Breaking Changes: New helper function that complements the existing
db_config()
Usage Example:
// Returns 'Default Name' if database is unavailable or any error occurs
safe_db_config('website.site_name', 'Default Name');When to Use:
- ✅ Service providers that run before database initialization
- ✅ Middleware or early application lifecycle hooks
- ✅ Development/CI environments with unreliable database access
- ✅ Migration or maintenance scenarios
- ✅ Any critical path where configuration failure shouldn't interrupt the app
🔧 Technical Details
- Full backward compatibility maintained
- No breaking changes
- Follows existing package conventions and coding standards