Exists
class Exists implements DatabasePresenceRule, Stringable
Traits
Properties
| protected string | $table | The table to run the query against. |
from DatabaseRule |
| protected string | $column | The column to check on. |
from DatabaseRule |
| protected array | $wheres | The extra where clauses for the query. |
from DatabaseRule |
| protected array | $using | The array of custom query callbacks. |
from DatabaseRule |
Methods
Apply the callback if the given "value" is (or resolves to) truthy.
Apply the callback if the given "value" is (or resolves to) falsy.
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 in" 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.
Convert the rule to a validation string.
Details
in
Conditionable at line 23
mixed
when(mixed $value = null, callable|null $callback = null, callable|null $default = null)
Apply the callback if the given "value" is (or resolves to) truthy.
in
Conditionable at line 56
mixed
unless(mixed $value = null, callable|null $callback = null, callable|null $default = null)
Apply the callback if the given "value" is (or resolves to) falsy.
in
DatabaseRule at line 40
__construct(string $table, string $column = 'NULL')
Create a new rule instance.
in
DatabaseRule at line 50
string
resolveTableName(string $table)
Resolves the name of the table from the given string.
in
DatabaseRule at line 74
DatabaseRule
where(Closure|string $column, mixed $value = null)
Set a "where" constraint on the query.
in
DatabaseRule at line 98
DatabaseRule
whereNot(string $column, mixed $value)
Set a "where not" constraint on the query.
in
DatabaseRule at line 112
DatabaseRule
whereNull(string $column)
Set a "where null" constraint on the query.
in
DatabaseRule at line 120
DatabaseRule
whereNotNull(string $column)
Set a "where not null" constraint on the query.
in
DatabaseRule at line 128
DatabaseRule
whereIn(string $column, array|Arrayable|BackedEnum $values)
Set a "where in" constraint on the query.
in
DatabaseRule at line 138
DatabaseRule
whereNotIn(string $column, array|Arrayable|BackedEnum $values)
Set a "where not in" constraint on the query.
in
DatabaseRule at line 148
DatabaseRule
withoutTrashed(string $deletedAtColumn = 'deleted_at')
Ignore soft deleted models during the existence check.s.
in
DatabaseRule at line 158
DatabaseRule
onlyTrashed(string $deletedAtColumn = 'deleted_at')
Only include soft deleted models during the existence check.
in
DatabaseRule at line 168
DatabaseRule
using(Closure $callback)
Register a custom query callback.
in
DatabaseRule at line 178
array
queryCallbacks()
Get the custom query callbacks for the rule.
in
DatabaseRule at line 188
array
presenceMetadata()
Get the database presence rule metadata.
in
DatabaseRule at line 201
protected string
formatWheres()
Format the where clauses.
at line 19
string
__toString()
Convert the rule to a validation string.