Skip to content

Releases: tanthammar/laravel-rules

added BusinessNameFromVatID case

03 Jul 18:17
Compare
Choose a tag to compare

Enhance BusinessNameFromVatID service with improved error handling

  • Add Invalid error case to BusinessNameLookupError enum for invalid VAT IDs
  • Add label() method to BusinessNameLookupError for human-readable messages
  • Pre-validate VAT format before external API calls to avoid unnecessary requests
  • Update README documentation to reflect new error handling capabilities

🤖 Generated with Claude Code

fix name removed in last commit

03 Jul 17:45
Compare
Choose a tag to compare
6.0.1

fix only name return

BREAKING CHANGE: Refactor BusinessNameFromVatID to returns ENUM instead of translated strings

03 Jul 17:36
Compare
Choose a tag to compare

BREAKING CHANGE: Refactor BusinessNameFromVatID to returns ENUM instead of translated strings

  • Add BusinessNameLookupError enum for error cases (Unknown, ServiceUnavailable)
  • BusinessNameFromVatID::lookup() now returns object|BusinessNameLookupError instead of string
  • On success: returns full VAT details object with name, address, vatNumber properties
  • On error: returns BusinessNameLookupError enum instead of translated error messages
  • Update README.md with new usage examples showing error handling patterns

This change provides access to complete VAT information while maintaining clean error handling through enums.

New Vat rules, drop laravel 9, breaking return types

03 Jul 15:27
Compare
Choose a tag to compare
✅ New: VatNumberAPI

✅ BREAKING CHANGE: Laravel 9 Support Dropped

  • Removed Laravel 9.0 support, now requires Laravel 10.0+

✅ BREAKING CHANGE: BusinessNameFromVatID Return Values

  • File: src/Services/BusinessNameFromVatID.php
  • Change: Now returns exception messages instead of generic "unknown" message when API is unavailable
  • Impact: Different error messages returned, may break code expecting specific text
  • Before: Always returned trans('laravel-rules::messages.vat-name-unknown') on API failure
  • After: Returns specific API error messages like "VIES EU Vat service api is unavailable. Please try again later." trans('laravel-rules::messages.vies-eu-unavailable')

✅ NON-BREAKING: Deprecation Warnings

  • File: src/Rules/VatNumber.php
  • Change: Added deprecation notice but maintained existing behavior
  • Impact: No breaking change, just deprecation warning

✅ NON-BREAKING: RuleHelpers Refactoring

  • File: src/RuleHelpers.php
  • Change: Methods now delegate to new service classes but maintain same signatures
  • Impact: No breaking change to public API

update dependencies

03 Jul 08:52
Compare
Choose a tag to compare

Updated

  • brick/phonenumber from 0.6.0 to 0.8.0
  • organisationsnummer/organisationsnummer from 1.x to 2.1.0

Bumping v, but no known breaking changes.
There are no known breaking changes related to rules in this pkg but if you use other parts of those dependencies read each pkg breaking changes.

fix validation trans path

01 Jul 22:13
Compare
Choose a tag to compare
3.4.1

trans path

Laravel 12

20 Apr 17:03
Compare
Choose a tag to compare
3.4.0

Update composer.json

Laravel 11

14 Mar 10:59
Compare
Choose a tag to compare
3.2.0

Update composer.json

Fix validation messages translations path

12 Dec 16:49
Compare
Choose a tag to compare
3.1.1

fix validator translations

more alpha dash rules + gdpr safe mobile/phone numbers

06 Dec 16:12
Compare
Choose a tag to compare
gdpr safe fake mobile and line line numbers

+ laravel lint cleanup