DiskConfig class

How to build a disk: its driver, its folder inside that driver, and its rules.

Configs are plain objects, so a driver of your own needs no registration: pass it to DiskConfig.custom.

Constructors

DiskConfig.assets({String prefix = 'assets', AssetBundle? bundle})
The app bundle under prefix, read-only.
factory
DiskConfig.custom(DiskDriver driver(), {String prefix = '', bool readOnly = false, Duration? prune})
A disk backed by your own DiskDriver.
factory
DiskConfig.local(DiskRoot root, {String prefix = '', bool readOnly = false, Duration? prune})
A folder on the device, inside root.
factory
DiskConfig.memory({String prefix = '', bool readOnly = false})
A disk that only lives in memory.
factory
DiskConfig.path(String root, {String prefix = '', bool readOnly = false, Duration? prune})
The folder at the absolute path root; Laravel's on-demand disk.
factory
DiskConfig.scoped(String disk, String prefix, {bool readOnly = false})
Another disk, under prefix; Laravel's scoped driver.
factory

Properties

createDriver → DiskDriver Function()?
Builds this disk's driver. Null for DiskConfig.scoped disks, which use the driver of the disk they scope.
final
hashCode → int
The hash code for this object.
no setterinherited
prefix → String
The folder inside the driver that the disk treats as its root.
final
protectRoot → bool
Whether emptying the whole disk is refused, because it is an OS folder that other plugins write to.
final
prune → Duration?
Files older than this are deleted the first time the disk is used in each session.
final
readOnly → bool
Whether writes are refused.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scopes → String?
The disk a DiskConfig.scoped disk sits inside.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited