Skip to content

v3.0.0

Choose a tag to compare

@rappasoft rappasoft released this 06 Dec 22:50
· 2 commits to master since this release
8a1db8e

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 execution
  • str() - String helper wrapper for fluent string operations
  • blank() - Determine if a value is "blank"
  • filled() - Determine if a value is "filled"
  • throw_if() - Conditionally throw exceptions
  • throw_unless() - Conditionally throw exceptions (inverse)
  • transform() - Transform values conditionally
  • windows_os() - Detect Windows operating system
  • retry() - Retry operations with exponential backoff
  • rescue() - Catch exceptions gracefully with fallback values

String Helpers

  • str_ascii() - Transliterate UTF-8 strings to ASCII
  • str_slug() - Generate URL-friendly slugs
  • str_plural() - Get plural form of English words
  • str_singular() - Get singular form of English words
  • str_ucfirst() - Uppercase first character (multibyte-safe)
  • str_lcfirst() - Lowercase first character (multibyte-safe)
  • str_mask() - Mask portions of strings
  • str_contains_any() - Check if string contains any of given substrings
  • str_excerpt() - Extract text excerpts around phrases
  • str_headline() - Convert strings to headline case
  • str_is_ascii() - Check if string is 7-bit ASCII
  • str_is_json() - Validate JSON strings
  • str_password() - Generate secure random passwords
  • str_reverse() - Reverse strings (multibyte-safe)
  • str_squish() - Remove extra whitespace
  • str_swap() - Swap multiple values in strings
  • str_wrap() - Word wrap strings

Array Helpers

  • array_key_first() - Get first array key
  • array_key_last() - Get last array key
  • array_map_assoc() - Map arrays preserving keys
  • array_map_with_keys() - Map arrays with key access
  • array_undot() - Expand dotted arrays to multi-dimensional
  • array_value_first() - Get first array value
  • array_value_last() - Get last array value

🐛 Bug Fixes

  • Fixed str_before_last() using incorrect str_substr() → changed to mb_substr()
  • Fixed array_flatten() depth parameter - now optional with default INF
  • Fixed array_random() preserveKeys parameter - now optional with default false
  • 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., childchildren)
  • Fixed singularization rules for irregular words (e.g., childrenchild)

🔧 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-helpers

For 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