class Exists implements Stringable (View source)
| Conditionable | |
| DatabaseRule |
| 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 |
| $this|TWhenReturnType | when($value = null, callable|null $callback = null, callable|null $default = null)
Apply the callback if the given "value" is (or resolves to) truthy. | from Conditionable |
| $this|TUnlessReturnType | unless($value = null, callable|null $callback = null, callable|null $default = null)
Apply the callback if the given "value" is (or resolves to) falsy. | from Conditionable |
| void | __construct(string $table, string $column = 'NULL')
Create a new rule instance. | from DatabaseRule |
| string | resolveTableName(string $table)
Resolves the name of the table from the given string. | from DatabaseRule |
| $this | where(Closure|string $column, Arrayable|BackedEnum|Closure|array|string|int|bool|null $value = null)
Set a "where" constraint on the query. | from DatabaseRule |
| $this | whereNot(string $column, Arrayable|BackedEnum|array|string $value)
Set a "where not" constraint on the query. | from DatabaseRule |
| $this | whereNull(string $column)
Set a "where null" constraint on the query. | from DatabaseRule |
| $this | whereNotNull(string $column)
Set a "where not null" constraint on the query. | from DatabaseRule |
| $this | whereIn(string $column, Arrayable|BackedEnum|array $values)
Set a "where in" constraint on the query. | from DatabaseRule |
| $this | whereNotIn(string $column, Arrayable|BackedEnum|array $values)
Set a "where not in" constraint on the query. | from DatabaseRule |
| $this | withoutTrashed(string $deletedAtColumn = 'deleted_at')
Ignore soft deleted models during the existence check. | from DatabaseRule |
| $this | onlyTrashed(string $deletedAtColumn = 'deleted_at')
Only include soft deleted models during the existence check. | from DatabaseRule |
| $this | using(Closure $callback)
Register a custom query callback. | from DatabaseRule |
| array | queryCallbacks()
Get the custom query callbacks for the rule. | from DatabaseRule |
| string | formatWheres()
Format the where clauses. | from DatabaseRule |
| string | __toString()
Convert the rule to a validation string. |
Apply the callback if the given "value" is (or resolves to) truthy.
Apply the callback if the given "value" is (or resolves to) falsy.
Create a new rule instance.
Resolves the name of the table from the given string.
Set a "where" constraint on the query.
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.
Only include soft deleted models during the existence check.
Register a custom query callback.
Get the custom query callbacks for the rule.
Format the where clauses.
Convert the rule to a validation string.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/11.x/Illuminate/Validation/Rules/Exists.html