interface Cloud implements Filesystem

Methods

string
path(string $path)

Get the full path to the file that exists at the given relative path.

bool
exists(string $path)

Determine if a file exists.

string|null
get(string $path)

Get the contents of a file.

mixed
readStream(string $path)

Get a resource to read the file.

mixed
readStreamRange(string $path, int|null $start, int|null $end)

Get a resource to read the partial file.

bool|string
put(string $path, mixed $contents, mixed $options = [])

Write the contents of a file.

false|string
putFile(string|File|UploadedFile $path, array|string|File|UploadedFile|null $file = null, mixed $options = [])

Store the uploaded file on the disk.

false|string
putFileAs(string|File|UploadedFile $path, array|string|File|UploadedFile|null $file, array|string|null $name = null, mixed $options = [])

Store the uploaded file on the disk with a given name.

bool
writeStream(string $path, mixed $resource, array $options = [])

Write a new file using a stream.

string
getVisibility(string $path)

Get the visibility for the given path.

bool
setVisibility(string $path, string $visibility)

Set the visibility for the given path.

bool
prepend(string $path, string $data)

Prepend to a file.

bool
append(string $path, string $data)

Append to a file.

bool
delete(array|string $paths)

Delete the file at a given path.

bool
copy(string $from, string $to)

Copy a file to a new location.

bool
move(string $from, string $to)

Move a file to a new location.

int
size(string $path)

Get the file size of a given file.

int
lastModified(string $path)

Get the file's last modification time.

array
files(string|null $directory = null, bool $recursive = false)

Get an array of all files in a directory.

array
allFiles(string|null $directory = null)

Get all of the files from the given directory (recursive).

array
directories(string|null $directory = null, bool $recursive = false)

Get all of the directories within a given directory.

array
allDirectories(string|null $directory = null)

Get all (recursive) of the directories within a given directory.

bool
makeDirectory(string $path)

Create a directory.

bool
deleteDirectory(string $directory)

Recursively delete a directory.

string
url(string $path)

Get the URL for the file at the given path.

Details

in Filesystem at line 31
string path(string $path)

Get the full path to the file that exists at the given relative path.

Parameters

string $path

Return Value

string

in Filesystem at line 36
bool exists(string $path)

Determine if a file exists.

Parameters

string $path

Return Value

bool

in Filesystem at line 41
string|null get(string $path)

Get the contents of a file.

Parameters

string $path

Return Value

string|null

in Filesystem at line 48
mixed readStream(string $path)

Get a resource to read the file.

Parameters

string $path

Return Value

mixed

the path resource or null on failure

in Filesystem at line 56
mixed readStreamRange(string $path, int|null $start, int|null $end)

Get a resource to read the partial file.

Parameters

string $path
int|null $start
int|null $end

Return Value

mixed

the path resource or null on failure

Exceptions

RuntimeException

in Filesystem at line 63
bool|string put(string $path, mixed $contents, mixed $options = [])

Write the contents of a file.

Parameters

string $path
mixed $contents
mixed $options

Return Value

bool|string

in Filesystem at line 68
false|string putFile(string|File|UploadedFile $path, array|string|File|UploadedFile|null $file = null, mixed $options = [])

Store the uploaded file on the disk.

Parameters

string|File|UploadedFile $path
array|string|File|UploadedFile|null $file
mixed $options

Return Value

false|string

in Filesystem at line 73
false|string putFileAs(string|File|UploadedFile $path, array|string|File|UploadedFile|null $file, array|string|null $name = null, mixed $options = [])

Store the uploaded file on the disk with a given name.

Parameters

string|File|UploadedFile $path
array|string|File|UploadedFile|null $file
array|string|null $name
mixed $options

Return Value

false|string

in Filesystem at line 80
bool writeStream(string $path, mixed $resource, array $options = [])

Write a new file using a stream.

Parameters

string $path
mixed $resource
array $options

Return Value

bool

in Filesystem at line 85
string getVisibility(string $path)

Get the visibility for the given path.

Parameters

string $path

Return Value

string

in Filesystem at line 90
bool setVisibility(string $path, string $visibility)

Set the visibility for the given path.

Parameters

string $path
string $visibility

Return Value

bool

in Filesystem at line 95
bool prepend(string $path, string $data)

Prepend to a file.

Parameters

string $path
string $data

Return Value

bool

in Filesystem at line 100
bool append(string $path, string $data)

Append to a file.

Parameters

string $path
string $data

Return Value

bool

in Filesystem at line 105
bool delete(array|string $paths)

Delete the file at a given path.

Parameters

array|string $paths

Return Value

bool

in Filesystem at line 110
bool copy(string $from, string $to)

Copy a file to a new location.

Parameters

string $from
string $to

Return Value

bool

in Filesystem at line 115
bool move(string $from, string $to)

Move a file to a new location.

Parameters

string $from
string $to

Return Value

bool

in Filesystem at line 120
int size(string $path)

Get the file size of a given file.

Parameters

string $path

Return Value

int

in Filesystem at line 125
int lastModified(string $path)

Get the file's last modification time.

Parameters

string $path

Return Value

int

in Filesystem at line 130
array files(string|null $directory = null, bool $recursive = false)

Get an array of all files in a directory.

Parameters

string|null $directory
bool $recursive

Return Value

array

in Filesystem at line 135
array allFiles(string|null $directory = null)

Get all of the files from the given directory (recursive).

Parameters

string|null $directory

Return Value

array

in Filesystem at line 140
array directories(string|null $directory = null, bool $recursive = false)

Get all of the directories within a given directory.

Parameters

string|null $directory
bool $recursive

Return Value

array

in Filesystem at line 145
array allDirectories(string|null $directory = null)

Get all (recursive) of the directories within a given directory.

Parameters

string|null $directory

Return Value

array

in Filesystem at line 150
bool makeDirectory(string $path)

Create a directory.

Parameters

string $path

Return Value

bool

in Filesystem at line 155
bool deleteDirectory(string $directory)

Recursively delete a directory.

Parameters

string $directory

Return Value

bool

at line 12
string url(string $path)

Get the URL for the file at the given path.

Parameters

string $path

Return Value

string