REDROOM
PHP 8.3.31
Path:
Logout
Edit File
Size: 3.24 KB
Close
/home/getspomw/royalsquad.us/vendor/laravel/framework/src/Illuminate/Validation/Rules/Date.php
Text
Base64
<?php namespace Illuminate\Validation\Rules; use DateTimeInterface; use Illuminate\Support\Arr; use Illuminate\Support\Traits\Conditionable; use Illuminate\Support\Traits\Macroable; use Stringable; class Date implements Stringable { use Conditionable, Macroable; /** * The constraints for the date rule. */ protected array $constraints = ['date']; /** * Ensure the date has the given format. */ public function format(string $format): static { return $this->addRule('date_format:'.$format); } /** * Ensure the date is before today. */ public function beforeToday(): static { return $this->before('today'); } /** * Ensure the date is after today. */ public function afterToday(): static { return $this->after('today'); } /** * Ensure the date is before or equal to today. */ public function todayOrBefore(): static { return $this->beforeOrEqual('today'); } /** * Ensure the date is after or equal to today. */ public function todayOrAfter(): static { return $this->afterOrEqual('today'); } /** * Ensure the date is before the given date or date field. */ public function before(DateTimeInterface|string $date): static { return $this->addRule('before:'.$this->formatDate($date)); } /** * Ensure the date is after the given date or date field. */ public function after(DateTimeInterface|string $date): static { return $this->addRule('after:'.$this->formatDate($date)); } /** * Ensure the date is on or before the specified date or date field. */ public function beforeOrEqual(DateTimeInterface|string $date): static { return $this->addRule('before_or_equal:'.$this->formatDate($date)); } /** * Ensure the date is on or after the given date or date field. */ public function afterOrEqual(DateTimeInterface|string $date): static { return $this->addRule('after_or_equal:'.$this->formatDate($date)); } /** * Ensure the date is between two dates or date fields. */ public function between(DateTimeInterface|string $from, DateTimeInterface|string $to): static { return $this->after($from)->before($to); } /** * Ensure the date is between or equal to two dates or date fields. */ public function betweenOrEqual(DateTimeInterface|string $from, DateTimeInterface|string $to): static { return $this->afterOrEqual($from)->beforeOrEqual($to); } /** * Add custom rules to the validation rules array. */ protected function addRule(array|string $rules): static { $this->constraints = array_merge($this->constraints, Arr::wrap($rules)); return $this; } /** * Format the date for the validation rule. */ protected function formatDate(DateTimeInterface|string $date): string { return $date instanceof DateTimeInterface ? $date->format('Y-m-d') : $date; } /** * Convert the rule to a validation string. */ public function __toString(): string { return implode('|', $this->constraints); } }
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).