Sorry, no results were found for this search.

Language Code

Validate ISO 639-1 Language Codes

162k Downloads / Month

Open Source MIT License

Learn how to validate ISO 639-1 Language Codes with the additional validation rules of Intervention Validation for your Laravel application.

public Intervention\Validation\Rules\LanguageCode::__construct(bool $strict = true)

The field under validation must be a valid language code according to ISO ISO 639-1.

Parameters

strict

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

Example

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

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