File
class File extends UploadedFile
Traits
Properties
protected string | $hashName | The cache copy of the file's hash name. |
from FileHelpers |
static protected array | $macros | The registered string macros. |
from Macroable |
string | $name | The name of the file. |
|
resource | $tempFile | The temporary file resource. |
|
int | $sizeToReport | The "size" to report. |
Methods
Dynamically handle calls to the class.
Dynamically handle calls to the class.
Store the uploaded file on a filesystem disk.
Store the uploaded file on a filesystem disk with public visibility.
Store the uploaded file on a filesystem disk with public visibility.
Store the uploaded file on a filesystem disk.
Create a new file instance from a base instance.
Create a new file instance.
Set the "size" of the file in kilobytes.
Get the size of the file.
Get the MIME type for the file.
Get the path to the temporary file.
Details
in
FileHelpers at line 21
string
path()
Get the fully qualified path to the file.
in
FileHelpers at line 31
string
extension()
Get the file's extension.
in
FileHelpers at line 41
string
clientExtension()
Get the file's extension supplied by the client.
in
FileHelpers at line 52
string
hashName(string $path = null)
Get a filename for the file.
in
Macroable at line 24
static void
macro(string $name, callable $macro)
Register a custom macro.
in
Macroable at line 35
static bool
hasMacro(string $name)
Checks if macro is registered.
in
Macroable at line 49
static mixed
__callStatic(string $method, array $parameters)
Dynamically handle calls to the class.
in
Macroable at line 71
mixed
__call(string $method, array $parameters)
Dynamically handle calls to the class.
in
UploadedFile at line 20
static FileFactory
fake()
Begin creating a new file fake.
in
UploadedFile at line 32
string|false
store(string $path, array|string $options = [])
Store the uploaded file on a filesystem disk.
in
UploadedFile at line 44
string|false
storePublicly(string $path, array|string $options = [])
Store the uploaded file on a filesystem disk with public visibility.
in
UploadedFile at line 61
string|false
storePubliclyAs(string $path, string $name, array|string $options = [])
Store the uploaded file on a filesystem disk with public visibility.
in
UploadedFile at line 78
string|false
storeAs(string $path, string $name, array|string $options = [])
Store the uploaded file on a filesystem disk.
in
UploadedFile at line 96
static UploadedFile
createFromBase(UploadedFile $file, bool $test = false)
Create a new file instance from a base instance.
in
UploadedFile at line 114
protected array
parseOptions(array|string $options)
Parse and format the given options.
at line 37
void
__construct(string $name, resource $tempFile)
Create a new file instance.
at line 55
static File
create(string $name, int $kilobytes = 0)
Create a new fake file.
at line 68
static File
image(string $name, int $width = 10, int $height = 10)
Create a new fake image.
at line 79
$this
size(int $kilobytes)
Set the "size" of the file in kilobytes.
at line 91
int
getSize()
Get the size of the file.
at line 101
string
getMimeType()
Get the MIME type for the file.
at line 111
protected string
tempFilePath()
Get the path to the temporary file.