Spec-Zone.ru › Laravel 6

Уникальный

класс Уникальный (Просмотреть исходный код)

Свойства

DatabaseRule

Свойства

protected string $table

Таблица, к которой будет обращаться запрос.

из DatabaseRule
protected string $column

Столбец, по которому будет проверка.

из DatabaseRule
protected array $wheres

Дополнительные условия where для запроса.

из DatabaseRule
protected array $using

Массив пользовательских обратных вызовов запроса.

из DatabaseRule
protected mixed $ignore

Идентификатор, который следует игнорировать.

protected string $idColumn

Имя столбца ID.

Методы

void __construct(string $table, string $column = 'NULL')

Создать новый экземпляр правила.

из DatabaseRule
string resolveTableName(string $table)

Определяет имя таблицы из заданной строки.

из DatabaseRule
$this where(Closure|string $column, array|string|null $value = null)

Установить ограничение "where" в запросе.

из DatabaseRule
$this whereNot(string $column, array|string $value)

Установить ограничение "where not" в запросе.

из DatabaseRule
$this whereNull(string $column)

Установить ограничение "where null" в запросе.

из DatabaseRule
$this whereNotNull(string $column)

Установить ограничение "where not null" в запросе.

из DatabaseRule

Подробное описание

void __construct(string $table, string $column = 'NULL')

Создать новый экземпляр правила.

Parameters

string $table
string $column

Return Value

void

string resolveTableName(string $table)

Разрешает имя таблицы из заданной строки.

Parameters

string $table

Return Value

string

$this where(Closure|string $column, array|string|null $value = null)

Установить ограничение "where" для запроса.

Parameters

Closure|string $column
array|string|null $value

Return Value

$this

$this whereNot(string $column, array|string $value)

Установить ограничение "where not" для запроса.

Parameters

string $column
array|string $value

Return Value

$this

$this whereNull(string $column)

Установить ограничение "where null" для запроса.

Parameters

string $column

Return Value

$this

$this whereNotNull(string $column)

Установить ограничение "where not null" для запроса.

Parameters

string $column

Return Value

$this

$this whereIn(string $column, array $values)

Установить ограничение "where in" для запроса.

Parameters

string $column
array $values

Return Value

$this

$this whereNotIn(string $column, array $values)

Установить ограничение "where not in" для запроса.

Parameters

string $column
array $values

Return Value

$this

$this using(Closure $callback)

Зарегистрировать пользовательский обратный вызов запроса.

Параметры

Closure $callback

Значение результата

$this

array queryCallbacks()

Получить пользовательские обратные вызовы запроса для правила.

Значение результата

array

protected string formatWheres()

Отформатировать условия where.

Значение результата

string

$this ignore(mixed $id, string|null $idColumn = null)

Игнорировать указанный идентификатор во время проверки уникальности.

Параметры

mixed $id
string|null $idColumn

Значение результата

$this

$this ignoreModel(Model $model, string|null $idColumn = null)

Игнорировать указанную модель во время проверки уникальности.

Параметры

Model $model
string|null $idColumn

Значение результата

$this

string __toString()

Преобразовать правило в строку валидации.

Значение результата

string

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/6.x/Illuminate/Validation/Rules/Unique.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API