Sorry, no results were found for this search.

Currency Code

Validate ISO 4217 Currency Codes

162k Downloads / Month

Open Source MIT License

Learn how to validate International Standard Book Numbers (ISBN) with the additional validation rules of Intervention Validation for your Laravel application.

public Intervention\Validation\Rules\CurrencyCode::__construct(string $format = CurrencyCode::ALPHA, bool $strict = true)

The field under validation must be a valid currency code according to ISO 4217.

Parameters

format

The currency code has two different formats CurrencyCode::ALPHA or CurrencyCode::NUMERIC. Select the format you want to check. Default CurrencyCode::ALPHA.

strict

If strict is true, the code must be passed in uppercase. Otherwise, the case doesn't matter.

Example

use Illuminate\Support\Facades\Validator;
use Intervention\Validation\Rules\CurrencyCode;

$validator = Validator::make($request->all(), [
    'attribute-key' => new CurrencyCode(),
]);
Edit