DatabaseRule
trait DatabaseRule
Properties
| protected string | $table | The table to run the query against. |
|
| protected string | $column | The column to check on. |
|
| protected array | $wheres | The extra where clauses for the query. |
|
| protected array | $using | The array of custom query callbacks. |
Methods
Create a new rule instance.
Resolves the name of the table from the given string.
Set a "where not" constraint on the query.
Set a "where null" constraint on the query.
Set a "where not null" constraint on the query.
Set a "where not in" constraint on the query.
Ignore soft deleted models during the existence checks.
Only include soft deleted models during the existence check.
Get the custom query callbacks for the rule.
Normalize a where value for string serialization.
Format the where clauses.
Details
at line 40
__construct(string $table, string $column = 'NULL')
Create a new rule instance.
at line 50
string
resolveTableName(string $table)
Resolves the name of the table from the given string.
at line 76
DatabaseRule
where(Closure|string $column, mixed $value = null)
Set a "where" constraint on the query.
at line 102
DatabaseRule
whereNot(string $column, mixed $value)
Set a "where not" constraint on the query.
at line 118
DatabaseRule
whereNull(string $column)
Set a "where null" constraint on the query.
at line 128
DatabaseRule
whereNotNull(string $column)
Set a "where not null" constraint on the query.
at line 138
DatabaseRule
whereIn(string $column, array|Arrayable|BackedEnum $values)
Set a "where in" constraint on the query.
at line 150
DatabaseRule
whereNotIn(string $column, array|Arrayable|BackedEnum $values)
Set a "where not in" constraint on the query.
at line 162
DatabaseRule
withoutTrashed(string $deletedAtColumn = 'deleted_at')
Ignore soft deleted models during the existence checks.
at line 174
DatabaseRule
onlyTrashed(string $deletedAtColumn = 'deleted_at')
Only include soft deleted models during the existence check.
at line 186
DatabaseRule
using(Closure $callback)
Register a custom query callback.
at line 196
array
queryCallbacks()
Get the custom query callbacks for the rule.
at line 204
protected mixed
normalizeWhereValue(mixed $value)
Normalize a where value for string serialization.
at line 214
protected string
formatWheres()
Format the where clauses.