Looking to hire Laravel developers? Try LaraJobs

laravel-bsn-validator maintained by wijzijnweb

Description
Dutch BSN validation for Laravel.
Author
Last update
2026/08/26 10:12 (dev-main)
License
Downloads
1

Comments
comments powered by Disqus

Dutch BSN validation for Laravel.

Installation

You can install the package via Composer:

composer require wijzijnweb/laravel-bsn-validator

You may publish all of the package's resources at once:

php artisan vendor:publish --tag="laravel-bsn-validator"

Or, you may publish each resource individually:

Publishing the Translations

php artisan vendor:publish --tag="laravel-bsn-validator-lang"

Usage

Validate a BSN directly:

use Wijzijnweb\LaravelBsnValidator\LaravelBsnValidator;

app(LaravelBsnValidator::class)->isValid('123456782'); // true

Or use the validation rule with Laravel's validator:

use Illuminate\Validation\Rule;

$request->validate([
    'bsn' => ['required', Rule::bsn()],
]);

The Wijzijnweb\LaravelBsnValidator\Rules\Bsn rule class can be used directly as an alternative to Rule::bsn().

Generating BSNs with Faker

This package ships a Faker provider for generating valid BSNs in your app's seeders and factories. It requires fakerphp/faker, which this package does not depend on directly, so make sure it's installed in your app:

use Wijzijnweb\LaravelBsnValidator\Faker\BsnProvider;

$faker->addProvider(new BsnProvider($faker));

$faker->bsn(); // e.g. '123456782'

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Thank you for considering contributing to Laravel BSN Validator! Please review our contributing guide to get started.

Credits

License

Laravel BSN Validator is open-sourced software licensed under the MIT license.