https://github.com/nembie/iban-rule
IBAN Rule is a Laravel package that provides a validation rule for IBANs
https://github.com/nembie/iban-rule
banking finance iban laravel laravel-framework php rule rules validation
Last synced: about 1 year ago
JSON representation
IBAN Rule is a Laravel package that provides a validation rule for IBANs
- Host: GitHub
- URL: https://github.com/nembie/iban-rule
- Owner: Nembie
- License: mit
- Created: 2023-04-12T15:17:35.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-05-30T14:07:41.000Z (about 2 years ago)
- Last Synced: 2025-04-13T09:57:08.108Z (about 1 year ago)
- Topics: banking, finance, iban, laravel, laravel-framework, php, rule, rules, validation
- Language: PHP
- Homepage:
- Size: 31.3 KB
- Stars: 7
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
## 🏦 IBAN Validation Rule for Laravel
[](LICENSE)
[](Issues)
[](Downloads)
[](Release)
This package provides a custom validation rule for Laravel to validate International Bank Account Numbers (IBANs). It uses the validation rules defined by the Single Euro Payments Area (SEPA) and other non-SEPA countries to ensure that the given IBAN is valid.
### 🧰 Requirements
- ```PHP >= 8.1```
- ```Laravel >= 10```
### ⚙️ Installation
You can install this package using Composer:
```composer require nembie/iban-rule```
### 👾 Usage
To use the IBAN validation rule, simply add it to your Laravel validation rules. Here's an example:
```php
use Illuminate\Http\Request;
use Nembie\IbanRule\ValidIban;
public function store(Request $request)
{
$request->validate([
'iban' => ['required', new ValidIban()],
]);
// The rest of your code
}
```
### 👽 Customize error message
You can use your own validation message (by default will be ```The :attribute is not a valid IBAN.```).
> :warning: **If you don't have these folders** use ```php artisan lang:publish```
Simply:
```bash
# Path
\main_folder_project
\lang
\app_language(ex.'en')
validation.php
# Add 'iban' key
'IBAN non valido.'
# Now you're validation message will be translated!
```
### 🔐 Validation Rules
This package uses the validation rules defined by the Single Euro Payments Area (SEPA) and other non-SEPA countries to ensure that the given IBAN is valid. The validation rules are loaded from a `countries.json` file that is included in this package.
### 🤝 Contribution
If you find any issues or have suggestions for improvements, feel free to open a pull request or issue. Your contribution is highly appreciated.
### 🌍 Supported countries
[Full list of supported countries](https://github.com/Nembie/nova-iban-field/blob/master/COUNTRIES.md)
### 🔨 Test
```composer test```
### 📝 License
This package is open-sourced software licensed under the [MIT license](https://github.com/Nembie/iban-rule/blob/main/LICENSE.md).