StorageDriverInterface
in
Interface for storage drivers (local filesystem, S3, etc.).
Tags
Table of Contents
Methods
- delete() : void
- Delete a file from storage.
- name() : string
- Get the driver name.
- put() : string
- Upload a local file to storage.
- url() : string
- Get the public URL for a stored file.
Methods
delete()
Delete a file from storage.
public
delete(string $storagePath) : void
Parameters
- $storagePath : string
-
Relative storage path
name()
Get the driver name.
public
name() : string
Return values
string —'local' or 's3'
put()
Upload a local file to storage.
public
put(string $localPath, string $storagePath, string $mimeType) : string
Parameters
- $localPath : string
-
Absolute path to the local file
- $storagePath : string
-
Relative storage path (e.g. "uploads/menu_photos/1/full/img.jpg")
- $mimeType : string
-
MIME type of the file
Return values
string —The storage path
url()
Get the public URL for a stored file.
public
url(string $storagePath) : string
Parameters
- $storagePath : string
-
Relative storage path
Return values
string —Full URL