class Illuminate / Validation / Rules / Unique
You are viewing an older version of the documentation. For the latest, please visit master documentation.

Unique

Uses

Properties

protected

$ignore mixed

The ID that should be ignored.

Default: null
protected

$idColumn string

The name of the ID column.

Default: 'id'

Methods

public

ignore ( $id , $idColumn ) : $this

Ignore the given ID during the unique check.

Parameters

  • $id mixed
  • $idColumn string|null
public

ignoreModel ( $model , $idColumn ) : $this

Ignore the given model during the unique check.

Parameters

  • $model Model
  • $idColumn string|null
public

withoutTrashed ( $deletedAtColumn ) : $this

Ignore soft deleted models during the unique check.

Parameters

  • $deletedAtColumn string
public

__toString ( ) : string

Convert the rule to a validation string.