Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Fr Validator Symfony

Fr Validator Symfony Laravel Package

petroslabs/fr-validator-symfony

Symfony Validator constraints for French data: validate SIRET, SIREN, VAT numbers, postal codes, and phone formats with drop-in constraint classes. Integrates with Symfony's validator service and works in Laravel apps built on the Symfony Validator component.

View on GitHub
Deep Wiki
Context7

Symfony Validator constraints for petroslabs/fr-validator (French identifiers)

Frequently asked questions about Fr Validator Symfony
Does petroslabs/fr-validator-symfony work with Laravel's native validation rules?
Not directly as a native Laravel Rule. The package provides Symfony Validator constraints, and the release notes do not confirm a Laravel service provider or Illuminate validation rule adapter. In Laravel you would typically use it through the Symfony Validator component or wrap each constraint in a custom Laravel rule. Treat the Laravel bridge as an adapter layer you own until the package documents native support.
How do I install petroslabs/fr-validator-symfony with Composer?
Install it with Composer using the package name petroslabs/fr-validator-symfony. Before running composer require, check the package's Composer constraints for PHP, Symfony Validator, and petroslabs/fr-validator versions. Because v0.1.0 is pre-stable, pin an exact version or a narrow constraint in composer.json. Then enable the Symfony bundle or wire the constraints into your Laravel adapter as needed.
Which French identifiers does this package validate?
The package targets French business and personal identifiers, including SIRET, SIREN, VAT/TVA, NIR, and postal codes. The v0.1.0 technical assessment also lists RIB, IBAN, BIC, NAF, and phone formats among the checks. Confirm the exact constraint list in the package source or README before relying on a specific identifier. Coverage of French overseas formats and international variants is not confirmed.
Can I use the constraints with PHP attributes, YAML, and XML mapping?
Yes. The package is designed for the Symfony Validator component and works with PHP attributes, YAML, and XML mapping. That means you can attach constraints to DTOs or entities using the mapping style your team already uses. In Laravel, mapping support depends on how you invoke Symfony Validator or expose the constraints through custom rules.
Are error messages translatable, and can I customize them?
The package provides translatable, customizable error messages through the Symfony Validator integration. The v0.1.0 assessment also notes that each constraint exposes a typed failure reason as both a message parameter and the violation code. That is useful for localized user messaging, API error contracts, and validation telemetry. Verify how those parameters and codes render in your Laravel response layer.
Which Laravel, PHP, and Symfony Validator versions does it support?
The release notes do not confirm exact Laravel, PHP, or Symfony Validator version ranges. Check the package's composer.json and the dependency on petroslabs/fr-validator before adoption. Because it is a v0.1.0 release, version constraints may change. Run a dependency audit and test against your application's exact Laravel and Symfony Validator versions.
Do the constraints validate checksums and registry data, or only format?
The available context does not confirm whether each constraint performs checksum or registry validation versus strict format checks. The underlying fr-validator library likely handles the domain logic, but you should verify each identifier's behavior in its source or tests. Add contract tests with valid, invalid, empty, and boundary inputs for all nine checks. This is especially important for SIRET, SIREN, VAT, NIR, IBAN, and BIC.
Is v0.1.0 stable enough for production Laravel applications?
Treat v0.1.0 as pre-stable and pilot it before production use. The technical assessment rates integration feasibility and technical risk as medium because native Laravel support is not confirmed and APIs may change. Pin the version exactly or with a narrow constraint, keep existing validation rules in place until contract tests pass, and roll out behind feature flags. Start with one or two constraints in a non-production branch.
How do I register the package in Laravel or as a Symfony bundle?
The package advertises automatic bundle registration and dependency injection wiring for Symfony. The release notes do not confirm a Laravel service provider or configuration publishing step. In Laravel, you may need to register the Symfony bundle manually or use the constraints through a custom rule or application service. Confirm the registration path against the package README and your framework version.
What should I test before adopting this package in a Laravel app?
Write contract tests for every constraint you plan to use, covering valid, invalid, empty, and boundary inputs. Verify how message parameters, violation codes, attribute names, and nullable or empty values behave under Laravel's validator lifecycle. Confirm that all nine checks behave as expected and that French overseas and international formats are in scope if you need them. Also test the adapter layer, translation rendering, and API error responses before rollout.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource