REDROOM
PHP 8.3.31
Path:
Logout
Edit File
Size: 5.37 KB
Close
/home/getspomw/royalsquad.us/vendor/laravel/framework/src/Illuminate/Validation/Rules/DatabaseRule.php
Text
Base64
<?php namespace Illuminate\Validation\Rules; use Closure; use Illuminate\Contracts\Support\Arrayable; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Collection; use function Illuminate\Support\enum_value; trait DatabaseRule { /** * The table to run the query against. * * @var string */ protected $table; /** * The column to check on. * * @var string */ protected $column; /** * The extra where clauses for the query. * * @var array */ protected $wheres = []; /** * The array of custom query callbacks. * * @var array */ protected $using = []; /** * Create a new rule instance. * * @param string $table * @param string $column * @return void */ public function __construct($table, $column = 'NULL') { $this->column = $column; $this->table = $this->resolveTableName($table); } /** * Resolves the name of the table from the given string. * * @param string $table * @return string */ public function resolveTableName($table) { if (! str_contains($table, '\\') || ! class_exists($table)) { return $table; } if (is_subclass_of($table, Model::class)) { $model = new $table; if (str_contains($model->getTable(), '.')) { return $table; } return implode('.', array_map(function (string $part) { return trim($part, '.'); }, array_filter([$model->getConnectionName(), $model->getTable()]))); } return $table; } /** * Set a "where" constraint on the query. * * @param \Closure|string $column * @param \Illuminate\Contracts\Support\Arrayable|\BackedEnum|\Closure|array|string|int|bool|null $value * @return $this */ public function where($column, $value = null) { if ($value instanceof Arrayable || is_array($value)) { return $this->whereIn($column, $value); } if ($column instanceof Closure) { return $this->using($column); } if (is_null($value)) { return $this->whereNull($column); } $value = enum_value($value); $this->wheres[] = compact('column', 'value'); return $this; } /** * Set a "where not" constraint on the query. * * @param string $column * @param \Illuminate\Contracts\Support\Arrayable|\BackedEnum|array|string $value * @return $this */ public function whereNot($column, $value) { if ($value instanceof Arrayable || is_array($value)) { return $this->whereNotIn($column, $value); } $value = enum_value($value); return $this->where($column, '!'.$value); } /** * Set a "where null" constraint on the query. * * @param string $column * @return $this */ public function whereNull($column) { return $this->where($column, 'NULL'); } /** * Set a "where not null" constraint on the query. * * @param string $column * @return $this */ public function whereNotNull($column) { return $this->where($column, 'NOT_NULL'); } /** * Set a "where in" constraint on the query. * * @param string $column * @param \Illuminate\Contracts\Support\Arrayable|\BackedEnum|array $values * @return $this */ public function whereIn($column, $values) { return $this->where(function ($query) use ($column, $values) { $query->whereIn($column, $values); }); } /** * Set a "where not in" constraint on the query. * * @param string $column * @param \Illuminate\Contracts\Support\Arrayable|\BackedEnum|array $values * @return $this */ public function whereNotIn($column, $values) { return $this->where(function ($query) use ($column, $values) { $query->whereNotIn($column, $values); }); } /** * Ignore soft deleted models during the existence check. * * @param string $deletedAtColumn * @return $this */ public function withoutTrashed($deletedAtColumn = 'deleted_at') { $this->whereNull($deletedAtColumn); return $this; } /** * Only include soft deleted models during the existence check. * * @param string $deletedAtColumn * @return $this */ public function onlyTrashed($deletedAtColumn = 'deleted_at') { $this->whereNotNull($deletedAtColumn); return $this; } /** * Register a custom query callback. * * @param \Closure $callback * @return $this */ public function using(Closure $callback) { $this->using[] = $callback; return $this; } /** * Get the custom query callbacks for the rule. * * @return array */ public function queryCallbacks() { return $this->using; } /** * Format the where clauses. * * @return string */ protected function formatWheres() { return (new Collection($this->wheres))->map(function ($where) { return $where['column'].','.'"'.str_replace('"', '""', $where['value']).'"'; })->implode(','); } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 17
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
ArrayRule.php
986 B
lrw-rw-rw-
2025-09-17 06:52:58
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Can.php
1.80 KB
lrw-rw-rw-
2025-09-17 06:52:58
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
DatabaseRule.php
5.37 KB
lrw-rw-rw-
2025-09-17 06:52:58
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Date.php
3.24 KB
lrw-rw-rw-
2025-09-17 06:52:58
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Dimensions.php
3.17 KB
lrw-rw-rw-
2025-09-17 06:52:58
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Email.php
6.59 KB
lrw-rw-rw-
2025-09-17 06:52:58
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Enum.php
3.43 KB
lrw-rw-rw-
2025-09-17 06:52:58
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ExcludeIf.php
1.06 KB
lrw-rw-rw-
2025-09-17 06:52:58
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Exists.php
476 B
lrw-rw-rw-
2025-09-17 06:52:58
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
File.php
9.25 KB
lrw-rw-rw-
2025-09-17 06:52:58
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ImageFile.php
508 B
lrw-rw-rw-
2025-09-17 06:52:58
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
In.php
1.20 KB
lrw-rw-rw-
2025-09-17 06:52:58
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
NotIn.php
1.14 KB
lrw-rw-rw-
2025-09-17 06:52:58
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Password.php
8.59 KB
lrw-rw-rw-
2025-09-17 06:52:58
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ProhibitedIf.php
1.07 KB
lrw-rw-rw-
2025-09-17 06:52:58
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
RequiredIf.php
999 B
lrw-rw-rw-
2025-09-17 06:52:58
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Unique.php
1.62 KB
lrw-rw-rw-
2025-09-17 06:52:58
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).