class UploadedFile extends UploadedFile (View source)

Traits

Properties

static protected array $macros The registered string macros. from Macroable

Methods

static void
macro(string $name, callable $macro)

Register a custom macro.

from Macroable
static bool
hasMacro(string $name)

Checks if macro is registered.

from Macroable
static mixed
__callStatic(string $method, array $parameters)

Dynamically handle calls to the class.

from Macroable
mixed
__call(string $method, array $parameters)

Dynamically handle calls to the class.

from Macroable
string
path()

Get the fully qualified path to the file.

string
extension()

Get the file's extension.

string
clientExtension()

Get the file's extension supplied by the client.

string
hashName(string $path = null)

Get a filename for the file that is the MD5 hash of the contents.

string|false
store(string $path, string|null $disk = null)

Store the uploaded file on a filesystem disk.

string|false
storeAs(string $path, string $name, string|null $disk = null)

Store the uploaded file on a filesystem disk.

static UploadedFile
createFromBase(UploadedFile $file, bool $test = false)

Create a new file instance from a base instance.

Details

static void macro(string $name, callable $macro)

Register a custom macro.

Parameters

string $name
callable $macro

Return Value

void

static bool hasMacro(string $name)

Checks if macro is registered.

Parameters

string $name

Return Value

bool

static mixed __callStatic(string $method, array $parameters)

Dynamically handle calls to the class.

Parameters

string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException

mixed __call(string $method, array $parameters)

Dynamically handle calls to the class.

Parameters

string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException

string path()

Get the fully qualified path to the file.

Return Value

string

string extension()

Get the file's extension.

Return Value

string

string clientExtension()

Get the file's extension supplied by the client.

Return Value

string

string hashName(string $path = null)

Get a filename for the file that is the MD5 hash of the contents.

Parameters

string $path

Return Value

string

string|false store(string $path, string|null $disk = null)

Store the uploaded file on a filesystem disk.

Parameters

string $path
string|null $disk

Return Value

string|false

string|false storeAs(string $path, string $name, string|null $disk = null)

Store the uploaded file on a filesystem disk.

Parameters

string $path
string $name
string|null $disk

Return Value

string|false

static UploadedFile createFromBase(UploadedFile $file, bool $test = false)

Create a new file instance from a base instance.

Parameters

UploadedFile $file
bool $test

Return Value

UploadedFile