v3.0.0
Release Notes - Version 3.0.0
🎉 Major Release - Laravel 10/11/12 Compatibility
This is a major release that brings the package up to date with Laravel 10, 11, and 12, adds numerous new helper functions, fixes bugs, and includes comprehensive test coverage.
⚠️ Breaking Changes
PHP Version Requirement
- Minimum PHP version increased from 7.3 to 8.1
- This aligns with Laravel 10/11/12 requirements
- Laravel 12 requires PHP 8.2+, but this package supports PHP 8.1+ for broader compatibility
- PHP 8.1+ provides better performance and modern language features
✨ New Features
General Helpers
dump()- Dump variables without terminating executionstr()- String helper wrapper for fluent string operationsblank()- Determine if a value is "blank"filled()- Determine if a value is "filled"throw_if()- Conditionally throw exceptionsthrow_unless()- Conditionally throw exceptions (inverse)transform()- Transform values conditionallywindows_os()- Detect Windows operating systemretry()- Retry operations with exponential backoffrescue()- Catch exceptions gracefully with fallback values
String Helpers
str_ascii()- Transliterate UTF-8 strings to ASCIIstr_slug()- Generate URL-friendly slugsstr_plural()- Get plural form of English wordsstr_singular()- Get singular form of English wordsstr_ucfirst()- Uppercase first character (multibyte-safe)str_lcfirst()- Lowercase first character (multibyte-safe)str_mask()- Mask portions of stringsstr_contains_any()- Check if string contains any of given substringsstr_excerpt()- Extract text excerpts around phrasesstr_headline()- Convert strings to headline casestr_is_ascii()- Check if string is 7-bit ASCIIstr_is_json()- Validate JSON stringsstr_password()- Generate secure random passwordsstr_reverse()- Reverse strings (multibyte-safe)str_squish()- Remove extra whitespacestr_swap()- Swap multiple values in stringsstr_wrap()- Word wrap strings
Array Helpers
array_key_first()- Get first array keyarray_key_last()- Get last array keyarray_map_assoc()- Map arrays preserving keysarray_map_with_keys()- Map arrays with key accessarray_undot()- Expand dotted arrays to multi-dimensionalarray_value_first()- Get first array valuearray_value_last()- Get last array value
🐛 Bug Fixes
- Fixed
str_before_last()using incorrectstr_substr()→ changed tomb_substr() - Fixed
array_flatten()depth parameter - now optional with defaultINF - Fixed
array_random()preserveKeys parameter - now optional with defaultfalse - Improved
dd()function to use Symfony VarDumper when available - Fixed
str_swap()double-replacement issue using placeholder approach - Fixed pluralization rules for irregular words (e.g.,
child→children) - Fixed singularization rules for irregular words (e.g.,
children→child)
🔧 Improvements
Code Quality
- Added explicit nullable type hints (
?type) for PHP 8.4 compatibility - Fixed all PHP 8.4 deprecation warnings
- Improved error handling and edge case coverage
Developer Experience
- Added comprehensive test suite with 105 tests and 234 assertions
- Added PHPUnit configuration with proper test organization
- Improved function documentation and type hints
- Better compatibility with PHP 8.1-8.4
📦 Dependencies
- PHP:
^8.1(previously^7.3|^8.0) - PHPUnit:
^10.0(dev dependency, for testing) - Symfony VarDumper: Suggested for improved
dd()output
🧪 Testing
- Complete test suite covering all helper functions
- Tests organized by category (Helpers, Strings, Arrays, Classes)
- 100% test coverage of new functions
- All tests passing with PHP 8.1-8.4
📚 Documentation
- Updated README.md with Laravel 10/11/12 compatibility notice
- Added testing documentation in
tests/README.md - Improved inline documentation for all functions
🔄 Migration Guide
For PHP 7.3/7.4/8.0 Users
You'll need to upgrade to PHP 8.1+ to use version 3.0.0:
# Check your PHP version
php -v
# If you're on PHP < 8.1, upgrade PHP first, then:
composer update rappasoft/laravel-helpersFor Existing Users
All existing helper functions remain backward compatible. New functions are additive and won't break existing code.
🙏 Acknowledgments
This release brings the package up to date with modern Laravel versions and PHP standards. Special thanks to the Laravel community for maintaining these helpful utilities.
📝 Full Changelog
Added
- 10 new general helper functions
- 18 new string helper functions
- 7 new array helper functions
- Comprehensive test suite (105 tests)
- PHPUnit configuration
- Testing documentation
Changed
- PHP requirement:
^7.3|^8.0→^8.1 - Improved
dd()function implementation - Enhanced type hints for better IDE support
Fixed
- 6 critical bugs in existing functions
- PHP 8.4 deprecation warnings
- Pluralization/singularization edge cases
- String manipulation multibyte issues
Removed
- Support for PHP 7.3 and 8.0
Upgrade today: composer require rappasoft/laravel-helpers:^3.0