title | weight |
---|---|
Validation attributes |
14 |
These are all the validation attributes currently available in laravel-data.
#[Accepted]
public bool $closure;
#[AcceptedIf('other_field', 'equals_this')]
public bool $closure;
#[ActiveUrl]
public string $closure;
#[After('tomorrow')]
public Carbon $closure;
#[After(Carbon::yesterday())]
public Carbon $closure;
// Always use field references when referencing other fields
#[After(new FieldReference('other_field'))]
public Carbon $closure;
#[AfterOrEqual('tomorrow')]
public Carbon $closure;
#[AfterOrEqual(Carbon::yesterday())]
public Carbon $closure;
// Always use field references when referencing other fields
#[AfterOrEqual(new FieldReference('other_field'))]
public Carbon $closure;
#[Alpha]
public string $closure;
#[AlphaDash]
public string $closure;
#[AlphaNumeric]
public string $closure;
#[ArrayType]
public array $closure;
#[ArrayType(['valid_key', 'other_valid_key'])]
public array $closure;
#[ArrayType('valid_key', 'other_valid_key')]
public array $closure;
#[Bail]
public string $closure;
#[Before('tomorrow')]
public Carbon $closure;
#[Before(Carbon::yesterday())]
public Carbon $closure;
// Always use field references when referencing other fields
#[Before(new FieldReference('other_field'))]
public Carbon $closure;
#[BeforeOrEqual('tomorrow')]
public Carbon $closure;
#[BeforeOrEqual(Carbon::yesterday())]
public Carbon $closure;
// Always use field references when referencing other fields
#[BeforeOrEqual(new FieldReference('other_field'))]
public Carbon $closure;
#[Between(3.14, 42)]
public int $closure;
#[BooleanType]
public bool $closure;
#[Confirmed]
public string $closure;
#[CurrentPassword]
public string $closure;
#[CurrentPassword('api')]
public string $closure;
#[Date]
public Carbon $date;
#[DateEquals('tomorrow')]
public Carbon $date;
#[DateEquals(Carbon::yesterday())]
public Carbon $date;
#[DateFormat('d-m-Y')]
public Carbon $date;
#[DateFormat(['Y-m-d', 'Y-m-d H:i:s'])]
public Carbon $date;
#[Declined]
public bool $closure;
#[DeclinedIf('other_field', 'equals_this')]
public bool $closure;
#[Different('other_field')]
public string $closure;
#[Digits(10)]
public int $closure;
#[DigitsBetween(2, 10)]
public int $closure;
#[Dimensions(ratio: 1.5)]
public UploadedFile $closure;
#[Dimensions(maxWidth: 100, maxHeight: 100)]
public UploadedFile $closure;
#[Distinct]
public string $closure;
#[Distinct(Distinct::Strict)]
public string $closure;
#[Distinct(Distinct::IgnoreCase)]
public string $closure;
#[DoesntEndWith('a')]
public string $closure;
#[DoesntEndWith(['a', 'b'])]
public string $closure;
#[DoesntEndWith('a', 'b')]
public string $closure;
#[DoesntStartWith('a')]
public string $closure;
#[DoesntStartWith(['a', 'b'])]
public string $closure;
#[DoesntStartWith('a', 'b')]
public string $closure;
#[Email]
public string $closure;
#[Email(Email::RfcValidation)]
public string $closure;
#[Email([Email::RfcValidation, Email::DnsCheckValidation])]
public string $closure;
#[Email(Email::RfcValidation, Email::DnsCheckValidation)]
public string $closure;
#[EndsWith('a')]
public string $closure;
#[EndsWith(['a', 'b'])]
public string $closure;
#[EndsWith('a', 'b')]
public string $closure;
#[Enum(ChannelType::class)]
public string $closure;
At the moment the data is not yet excluded due to technical reasons, v4 should fix this
#[ExcludeIf('other_field', 'has_value')]
public string $closure;
At the moment the data is not yet excluded due to technical reasons, v4 should fix this
#[ExcludeUnless('other_field', 'has_value')]
public string $closure;
At the moment the data is not yet excluded due to technical reasons, v4 should fix this
#[ExcludeWith('other_field')]
public string $closure;
At the moment the data is not yet excluded due to technical reasons, v4 should fix this
#[ExcludeWithout('other_field')]
public string $closure;
#[Exists('users')]
public string $closure;
#[Exists(User::class)]
public string $closure;
#[Exists('users', 'email')]
public string $closure;
#[Exists('users', 'email', connection: 'tenant')]
public string $closure;
#[Exists('users', 'email', withoutTrashed: true)]
public string $closure;
#[File]
public UploadedFile $closure;
#[Filled]
public string $closure;
#[GreaterThan('other_field')]
public int $closure;
#[GreaterThanOrEqualTo('other_field')]
public int $closure;
#[Image]
public UploadedFile $closure;
#[In([1, 2, 3, 'a', 'b'])]
public mixed $closure;
#[In(1, 2, 3, 'a', 'b')]
public mixed $closure;
#[InArray('other_field')]
public string $closure;
#[IntegerType]
public int $closure;
#[IP]
public string $closure;
#[IPv4]
public string $closure;
#[IPv6]
public string $closure;
#[Json]
public string $closure;
#[LessThan('other_field')]
public int $closure;
#[LessThanOrEqualTo('other_field')]
public int $closure;
#[Lowercase]
public string $closure;
#[ListType]
public array $array;
#[MacAddress]
public string $closure;
#[Max(20)]
public int $closure;
#[MaxDigits(10)]
public int $closure;
#[MimeTypes('video/quicktime')]
public UploadedFile $closure;
#[MimeTypes(['video/quicktime', 'video/avi'])]
public UploadedFile $closure;
#[MimeTypes('video/quicktime', 'video/avi')]
public UploadedFile $closure;
#[Mimes('jpg')]
public UploadedFile $closure;
#[Mimes(['jpg', 'png'])]
public UploadedFile $closure;
#[Mimes('jpg', 'png')]
public UploadedFile $closure;
#[Min(20)]
public int $closure;
#[MinDigits(2)]
public int $closure;
#[MultipleOf(3)]
public int $closure;
#[NotIn([1, 2, 3, 'a', 'b'])]
public mixed $closure;
#[NotIn(1, 2, 3, 'a', 'b')]
public mixed $closure;
#[NotRegex('/^.+$/i')]
public string $closure;
#[Nullable]
public ?string $closure;
#[Numeric]
public ?string $closure;
#[Password(min: 12, letters: true, mixedCase: true, numbers: false, symbols: false, uncompromised: true, uncompromisedThreshold: 0)]
public string $closure;
#[Present]
public string $closure;
#[Prohibited]
public ?string $closure;
#[ProhibitedIf('other_field', 'has_value')]
public ?string $closure;
#[ProhibitedIf('other_field', ['has_value', 'or_this_value'])]
public ?string $closure;
#[ProhibitedUnless('other_field', 'has_value')]
public ?string $closure;
#[ProhibitedUnless('other_field', ['has_value', 'or_this_value'])]
public ?string $closure;
#[Prohibits('other_field')]
public ?string $closure;
#[Prohibits(['other_field', 'another_field'])]
public ?string $closure;
#[Prohibits('other_field', 'another_field')]
public ?string $closure;
#[Regex('/^.+$/i')]
public string $closure;
#[Required]
public string $closure;
#[RequiredIf('other_field', 'value')]
public ?string $closure;
#[RequiredIf('other_field', ['value', 'another_value'])]
public ?string $closure;
#[RequiredUnless('other_field', 'value')]
public ?string $closure;
#[RequiredUnless('other_field', ['value', 'another_value'])]
public ?string $closure;
#[RequiredWith('other_field')]
public ?string $closure;
#[RequiredWith(['other_field', 'another_field'])]
public ?string $closure;
#[RequiredWith('other_field', 'another_field')]
public ?string $closure;
#[RequiredWithAll('other_field')]
public ?string $closure;
#[RequiredWithAll(['other_field', 'another_field'])]
public ?string $closure;
#[RequiredWithAll('other_field', 'another_field')]
public ?string $closure;
#[RequiredWithout('other_field')]
public ?string $closure;
#[RequiredWithout(['other_field', 'another_field'])]
public ?string $closure;
#[RequiredWithout('other_field', 'another_field')]
public ?string $closure;
#[RequiredWithoutAll('other_field')]
public ?string $closure;
#[RequiredWithoutAll(['other_field', 'another_field'])]
public ?string $closure;
#[RequiredWithoutAll('other_field', 'another_field')]
public ?string $closure;
#[RequiredArrayKeys('a')]
public array $closure;
#[RequiredArrayKeys(['a', 'b'])]
public array $closure;
#[RequiredArrayKeys('a', 'b')]
public array $closure;
#[Rule('string|uuid')]
public string $closure;
#[Rule(['string','uuid'])]
public string $closure;
#[Same('other_field')]
public string $closure;
#[Size(10)]
public string $closure;
#[Sometimes]
public string $closure;
#[StartsWith('a')]
public string $closure;
#[StartsWith(['a', 'b'])]
public string $closure;
#[StartsWith('a', 'b')]
public string $closure;
#[StringType()]
public string $closure;
#[TimeZone()]
public string $closure;
#[Unique('users')]
public string $closure;
#[Unique(User::class)]
public string $closure;
#[Unique('users', 'email')]
public string $closure;
#[Unique('users', connection: 'tenant')]
public string $closure;
#[Unique('users', withoutTrashed: true)]
public string $closure;
#[Unique('users', ignore: 5)]
public string $closure;
#[Uppercase]
public string $closure;
#[Url]
public string $closure;
#[Ulid]
public string $closure;
#[Uuid]
public string $closure;