---
application: "Intervention Validation"
version: "Version 4"
status: "stable"
---

# Language Code

## Validate ISO 639-1 Language Codes

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](https://en.wikipedia.org/wiki/ISO_639-1) 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

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

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

---

## Become a Sponsor

### Intervention Validation needs your help to keep the project going

Intervention Validation is non-commercial, open source licensed and completely free to use. The considerable
effort required to maintain and develop the software is only possible with the financial support
of sponsors. There are two ways in which you can support this project.

- Support via [GitHub Sponsors](https://github.com/sponsors/Intervention)
- Support via [Ko-Fi](https://ko-fi.com/interventionphp)