ArrayType
class ArrayType extends Type (View source)
Properties
| protected bool|null | $required | Whether the type is required. |
from Type |
| protected string|null | $title | The type's title. |
from Type |
| protected string|null | $description | The type's description. |
from Type |
| protected mixed | $default | The default value for the type. |
from Type |
| protected array<int, mixed>|null | $enum | The set of allowed values for the type. |
from Type |
| protected bool|null | $nullable | Indicates if the type is nullable. |
from Type |
| protected int|null | $minItems | The minimum number of items (inclusive). |
|
| protected int|null | $maxItems | The maximum number of items (inclusive). |
|
| protected Type|null | $items | The schema of the items contained in the array. |
|
| protected bool|null | $uniqueItems | Whether the array items must be unique. |
Methods
Build a type from a raw array of the Laravel-supported JSON Schema subset.
Dynamically pass static methods to the schema instance.
No description
Details
static Type
fromArray(array $schema)
Build a type from a raw array of the Laravel-supported JSON Schema subset.
static Type
__callStatic(string $name, mixed $arguments)
Dynamically pass static methods to the schema instance.
static ObjectType
object(Closure|array<string $, Type> $properties = '[]')
No description
static AnyOfType
anyOf(Closure|array<int $, Type> $schemas)
No description
static IntegerType
integer()
No description
static NumberType
number()
No description
static StringType
string()
No description
static BooleanType
boolean()
No description
static ArrayType
array()
No description
static UnionType
union(array<int $, string> $types)
No description
in
Type at line 47
Type
required(bool $required = true)
Indicate that the type is required.
in
Type at line 57
Type
nullable(bool $nullable = true)
Indicate that the type is optional.
in
Type at line 67
Type
title(string $value)
Set the type's title.
in
Type at line 77
Type
description(string $value)
Set the type's description.
in
Type at line 91
Type
enum(array|string $values)
Restrict the value to one of the provided enumerated values.
in
Type at line 112
array
toArray()
Convert the type to an array.
in
Type at line 120
string
toString()
Convert the type to its string representation.
in
Type at line 128
string
__toString()
Convert the type to its string representation.
ArrayType
min(int $value)
Set the minimum number of items (inclusive).
ArrayType
max(int $value)
Set the maximum number of items (inclusive).
ArrayType
unique(bool $unique = true)
Indicate that the array items must be unique.
ArrayType
default(array $value)
Set the type's default value.
Laravel Cloud is the best place to deploy Laravel, Nuxt, Express, Hono, Node.js, Bun, Go, Flask, Python, and more, with dedicated infrastructure available on AWS through Laravel Private Cloud.