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 check.s.
Only include soft deleted models during the existence check.
Get the custom query callbacks for the rule.
Get the database presence rule metadata.
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 74
DatabaseRule
where(Closure|string $column, mixed $value = null)
Set a "where" constraint on the query.
at line 98
DatabaseRule
whereNot(string $column, mixed $value)
Set a "where not" constraint on the query.
at line 112
DatabaseRule
whereNull(string $column)
Set a "where null" constraint on the query.
at line 120
DatabaseRule
whereNotNull(string $column)
Set a "where not null" constraint on the query.
at line 128
DatabaseRule
whereIn(string $column, array|Arrayable|BackedEnum $values)
Set a "where in" constraint on the query.
at line 138
DatabaseRule
whereNotIn(string $column, array|Arrayable|BackedEnum $values)
Set a "where not in" constraint on the query.
at line 148
DatabaseRule
withoutTrashed(string $deletedAtColumn = 'deleted_at')
Ignore soft deleted models during the existence check.s.
at line 158
DatabaseRule
onlyTrashed(string $deletedAtColumn = 'deleted_at')
Only include soft deleted models during the existence check.
at line 168
DatabaseRule
using(Closure $callback)
Register a custom query callback.
at line 178
array
queryCallbacks()
Get the custom query callbacks for the rule.
at line 188
array
presenceMetadata()
Get the database presence rule metadata.
at line 201
protected string
formatWheres()
Format the where clauses.