abstract class File implements HasName, HasProviderOptions

Properties

string|null $name
string|null $mime
protected array<string, string>|SerializableClosure $headers
protected array<string, mixed>|SerializableClosure $providerOptions

Methods

static File|null
fromArray(array $data)

Reconstruct a file instance from its array representation.

static string
value(array $data, string $key, string $type)

Get a required value from the file representation.

string|null
name()

Get the displayable name of the file.

as(string|null $name)

Set the displayable name of the file.

withHeaders(array|Closure $headers)

Specify HTTP headers for the file upload. Closures may only capture serializable values.

withProviderOptions(array|Closure $options)

Specify provider-specific options for the file upload. Closures may only capture serializable values.

array
providerOptions(Lab|string $provider)

Get the provider-specific options for the file upload.

array
headers(Lab|string $provider)

Get the HTTP headers for the file upload.

string|null
mimeType()

Get the file's MIME type.

withMimeType(string $mimeType)

Set the file's MIME type.

Details

at line 29
static File|null fromArray(array $data)

Reconstruct a file instance from its array representation.

Parameters

array $data

Return Value

File|null

at line 70
static protected string value(array $data, string $key, string $type)

Get a required value from the file representation.

Parameters

array $data
string $key
string $type

Return Value

string

at line 82
string|null name()

Get the displayable name of the file.

Return Value

string|null

at line 90
HasName as(string|null $name)

Set the displayable name of the file.

Parameters

string|null $name

Return Value

HasName

at line 102
File withHeaders(array|Closure $headers)

Specify HTTP headers for the file upload. Closures may only capture serializable values.

Parameters

array|Closure $headers

Return Value

File

at line 116
File withProviderOptions(array|Closure $options)

Specify provider-specific options for the file upload. Closures may only capture serializable values.

Parameters

array|Closure $options

Return Value

File

at line 130
array providerOptions(Lab|string $provider)

Get the provider-specific options for the file upload.

Parameters

Lab|string $provider

Return Value

array

at line 142
array headers(Lab|string $provider)

Get the HTTP headers for the file upload.

Parameters

Lab|string $provider

Return Value

array

at line 152
string|null mimeType()

Get the file's MIME type.

Return Value

string|null

at line 160
File withMimeType(string $mimeType)

Set the file's MIME type.

Parameters

string $mimeType

Return Value

File