File
class File extends UploadedFile (View source)
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.  | 
                |
| string|null | $mimeTypeToReport | The MIME type to report.  | 
                
Methods
Mix another object into the class.
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.
Create a new fake file with content.
Set the "size" of the file in kilobytes.
Get the size of the file.
Set the "MIME type" for the file.
Get the MIME type of the file.
Get the path to the temporary file.
Details
        
                            string
    path()
        
    
    Get the fully qualified path to the file.
        
                            string
    extension()
        
    
    Get the file's extension.
        
                            string
    hashName(string|null $path = null)
        
    
    Get a filename for the file.
        
                static            void
    macro(string $name, object|callable $macro)
        
    
    Register a custom macro.
        
                static            void
    mixin(object $mixin, bool $replace = true)
        
    
    Mix another object into the class.
        
                static            bool
    hasMacro(string $name)
        
    
    Checks if macro is registered.
        
                static            void
    flushMacros()
        
    
    Flush the existing macros.
        
                static            mixed
    __callStatic(string $method, array $parameters)
        
    
    Dynamically handle calls to the class.
        
                            mixed
    __call(string $method, array $parameters)
        
    
    Dynamically handle calls to the class.
        
                static            FileFactory
    fake()
        
    
    Begin creating a new file fake.
        
                            string|false
    store(string $path, array|string $options = [])
        
    
    Store the uploaded file on a filesystem disk.
        
                            string|false
    storePublicly(string $path, array|string $options = [])
        
    
    Store the uploaded file on a filesystem disk with public visibility.
        
                            string|false
    storePubliclyAs(string $path, string $name, array|string $options = [])
        
    
    Store the uploaded file on a filesystem disk with public visibility.
        
                            string|false
    storeAs(string $path, string $name, array|string $options = [])
        
    
    Store the uploaded file on a filesystem disk.
        
                            false|string
    get()
        
    
    Get the contents of the uploaded file.
        
                            string
    clientExtension()
        
    
    Get the file's extension supplied by the client.
        
                static            UploadedFile
    createFromBase(UploadedFile $file, bool $test = false)
        
    
    Create a new file instance from a base instance.
        
                    protected        array
    parseOptions(array|string $options)
        
    
    Parse and format the given options.
        
                            void
    __construct(string $name, resource $tempFile)
        
    
    Create a new file instance.
        
                static            File
    create(string $name, string|int $kilobytes = 0)
        
    
    Create a new fake file.
        
                static            File
    createWithContent(string $name, string $content)
        
    
    Create a new fake file with content.
        
                static            File
    image(string $name, int $width = 10, int $height = 10)
        
    
    Create a new fake image.
        
                            $this
    size(int $kilobytes)
        
    
    Set the "size" of the file in kilobytes.
        
                            int
    getSize()
        
    
    Get the size of the file.
        
                            $this
    mimeType(string $mimeType)
        
    
    Set the "MIME type" for the file.
        
                            string
    getMimeType()
        
    
    Get the MIME type of the file.
        
                    protected        string
    tempFilePath()
        
    
    Get the path to the temporary file.