DatabaseRule
trait DatabaseRule (View source)
Properties
Methods
__construct(string $table, string $column = 'NULL')
Create a new rule instance.
string
resolveTableName(string $table)
Resolves the name of the table from the given string.
$this
$this
$this
whereNull(string $column)
Set a "where null" constraint on the query.
$this
whereNotNull(string $column)
Set a "where not null" constraint on the query.
$this
$this
whereNotIn(string $column, Arrayable|BackedEnum|array $values)
Set a "where not in" constraint on the query.
$this
withoutTrashed(string $deletedAtColumn = 'deleted_at')
Ignore soft deleted models during the existence check.
$this
onlyTrashed(string $deletedAtColumn = 'deleted_at')
Only include soft deleted models during the existence check.
array
queryCallbacks()
Get the custom query callbacks for the rule.
string
formatWheres()
Format the where clauses.
Details
$this
where(Closure|string $column, Arrayable|UnitEnum|Closure|array|string|int|bool|null $value = null)
Set a "where" constraint on the query.
$this
whereNot(string $column, Arrayable|UnitEnum|array|string $value)
Set a "where not" constraint on the query.
$this
whereIn(string $column, Arrayable|BackedEnum|array $values)
Set a "where in" constraint on the query.
$this
whereNotIn(string $column, Arrayable|BackedEnum|array $values)
Set a "where not in" constraint on the query.
$this
withoutTrashed(string $deletedAtColumn = 'deleted_at')
Ignore soft deleted models during the existence check.