Disks

Disks are the top-most structural component for the Files module. Files reside in a folder. Folders reside on a disk. The disk determines "where" the files are stored like locally on the server or on Amazon S3.

Disk Interface

This section will go over the features of the \Anomaly\FilesModule\Disk\Contract\DiskInterface class.

DiskInterface::filesystem()

The filesystem returns the disk adapter's filesystem.

Returns: \Anomaly\FilesModule\Disk\Adapter\AdapterFilesystem
Example
$disk->filesystem();
DiskInterface::getFolders()

The getFolders method returns a collection of related folders.

Returns: \Anomaly\FilesModule\Folder\FolderCollection
Example
foreach ($disk->getFolders() as $folder) {
    echo $folder->getName();
}
DiskInterface::folders()

The folders returns the folder relationship.

Returns: \Illuminate\Database\Eloquent\Relations\HasMany
Example
$disk->folders()->where('name', 'LIKE', '%Gallery Images')->get();