Skip to content

Latest commit

 

History

History
30 lines (20 loc) · 710 Bytes

isbn.md

File metadata and controls

30 lines (20 loc) · 710 Bytes

ISBN Rule

Validate International Standard Book Number

public Intervention\Validation\Rules\Isbn::__construct(array $lengths = [10, 13])

The field under validation must be a valid International Standard Book Number (ISBN).

Parameters

lengths (optional)

Optional array of allowed lengths to check only for ISBN-10 or ISBN-13.

Example

use Intervention\Validation\Rules\Isbn;

$validator = Validator::make($request->all(), [
    'attribute-key' => new Isbn(),
]);
use Intervention\Validation\Rules\Isbn;

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