disk method

StorageDisk disk([
  1. String? name
])

Returns a disk instance by name or uses the default.

Implementation

StorageDisk disk([String? name]) {
  final key = name ?? _defaultDisk;
  final disk = _disks[key];

  if (disk == null) {
    throw NotFoundException('Storage disk "$key" is not defined.');
  }

  return disk;
}