Type
abstract class Type extends JsonSchema (View source)
Properties
| protected bool|null | $required | Whether the type is required. |
|
| protected string|null | $title | The type's title. |
|
| protected string|null | $description | The type's description. |
|
| protected mixed | $default | The default value for the type. |
|
| protected array<int, mixed>|null | $enum | The set of allowed values for the type. |
|
| protected bool|null | $nullable | Indicates if the type is nullable. |
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
Set the type's description.
Convert the type to an array.
Convert the type to its string representation.
Convert the type to its string representation.
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
Type
required(bool $required = true)
Indicate that the type is required.
Type
nullable(bool $nullable = true)
Indicate that the type is optional.
Type
title(string $value)
Set the type's title.
Type
description(string $value)
Set the type's description.
Type
enum(array|string $values)
Restrict the value to one of the provided enumerated values.
array
toArray()
Convert the type to an array.
string
toString()
Convert the type to its string representation.
string
__toString()
Convert the type to its string representation.
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.