---
application: "Intervention Validation"
version: "Version 3"
status: "eol"
---

# ISBN Rule

## Validate International Standard Book Number



> public Intervention\Validation\Rules\Isbn::__construct(?int $length = null)

The field under validation must be a valid [International Standard Book Number](https://en.wikipedia.org/wiki/International_Standard_Book_Number) (ISBN).

### Parameters

#### length (optional)

Optional length parameter as integer to check only for ISBN-10 or ISBN-13.

### Example

```php
use Intervention\Validation\Rules\Isbn;

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

---

## 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)