class FilesystemManager implements Factory mixin Filesystem mixin FilesystemAdapter (View source)

Traits

Properties

protected Application $app

The application instance.

protected array $disks

The array of resolved filesystem drivers.

protected array $customCreators

The registered custom driver creators.

Methods

Closure|null
bindCallbackToSelf(Closure $callback)

Binds the provided callback to the class instance.

__construct(Application $app)

Create a new filesystem manager instance.

drive(UnitEnum|string|null $name = null)

Get a filesystem instance.

disk(UnitEnum|string|null $name = null)

Get a filesystem instance.

cloud()

Get a default cloud filesystem instance.

build(string|array $config)

Build an on-demand disk.

get(string $name)

Attempt to get the disk from the local cache.

resolve(string $name, array|null $config = null)

Resolve the given disk.

callCustomCreator(array $config)

Call a custom driver creator.

createLocalDriver(array $config, string $name = 'local')

Create an instance of the local driver.

createFtpDriver(array $config)

Create an instance of the ftp driver.

createSftpDriver(array $config)

Create an instance of the sftp driver.

createS3Driver(array $config)

Create an instance of the Amazon S3 driver.

array
formatS3Config(array $config)

Format the given S3 configuration with the default options.

createScopedDriver(array $config)

Create a scoped driver.

FilesystemOperator
createFlysystem(FilesystemAdapter $adapter, array $config)

Create a Flysystem instance with the given adapter.

$this
set(string $name, mixed $disk)

Set the given disk instance.

array
getConfig(string $name)

Get the filesystem connection configuration.

string
getDefaultDriver()

Get the default driver name.

string
getDefaultCloudDriver()

Get the default cloud driver name.

$this
forgetDisk(array|string $disk)

Unset the given disk instances.

void
purge(string|null $name = null)

Disconnect the given disk and remove from local cache.

$this
extend(string $driver, Closure $callback)

Register a custom driver creator Closure.

$this
setApplication(Application $app)

Set the application instance used by the manager.

mixed
__call(string $method, array $parameters)

Dynamically call the default driver instance.

Details

protected Closure|null bindCallbackToSelf(Closure $callback)

Binds the provided callback to the class instance.

Parameters

Closure $callback

Return Value

Closure|null

Exceptions

ReflectionException

__construct(Application $app)

Create a new filesystem manager instance.

Parameters

Application $app

Filesystem drive(UnitEnum|string|null $name = null)

Get a filesystem instance.

Parameters

UnitEnum|string|null $name

Return Value

Filesystem

Filesystem disk(UnitEnum|string|null $name = null)

Get a filesystem instance.

Parameters

UnitEnum|string|null $name

Return Value

Filesystem

Cloud cloud()

Get a default cloud filesystem instance.

Return Value

Cloud

Filesystem build(string|array $config)

Build an on-demand disk.

Parameters

string|array $config

Return Value

Filesystem

protected Filesystem get(string $name)

Attempt to get the disk from the local cache.

Parameters

string $name

Return Value

Filesystem

protected Filesystem resolve(string $name, array|null $config = null)

Resolve the given disk.

Parameters

string $name
array|null $config

Return Value

Filesystem

Exceptions

InvalidArgumentException

protected Filesystem callCustomCreator(array $config)

Call a custom driver creator.

Parameters

array $config

Return Value

Filesystem

Filesystem createLocalDriver(array $config, string $name = 'local')

Create an instance of the local driver.

Parameters

array $config
string $name

Return Value

Filesystem

Filesystem createFtpDriver(array $config)

Create an instance of the ftp driver.

Parameters

array $config

Return Value

Filesystem

Filesystem createSftpDriver(array $config)

Create an instance of the sftp driver.

Parameters

array $config

Return Value

Filesystem

Cloud createS3Driver(array $config)

Create an instance of the Amazon S3 driver.

Parameters

array $config

Return Value

Cloud

protected array formatS3Config(array $config)

Format the given S3 configuration with the default options.

Parameters

array $config

Return Value

array

Filesystem createScopedDriver(array $config)

Create a scoped driver.

Parameters

array $config

Return Value

Filesystem

Exceptions

InvalidArgumentException

protected FilesystemOperator createFlysystem(FilesystemAdapter $adapter, array $config)

Create a Flysystem instance with the given adapter.

Parameters

FilesystemAdapter $adapter
array $config

Return Value

FilesystemOperator

$this set(string $name, mixed $disk)

Set the given disk instance.

Parameters

string $name
mixed $disk

Return Value

$this

protected array getConfig(string $name)

Get the filesystem connection configuration.

Parameters

string $name

Return Value

array

string getDefaultDriver()

Get the default driver name.

Return Value

string

string getDefaultCloudDriver()

Get the default cloud driver name.

Return Value

string

$this forgetDisk(array|string $disk)

Unset the given disk instances.

Parameters

array|string $disk

Return Value

$this

void purge(string|null $name = null)

Disconnect the given disk and remove from local cache.

Parameters

string|null $name

Return Value

void

$this extend(string $driver, Closure $callback)

Register a custom driver creator Closure.

Parameters

string $driver
Closure $callback

Return Value

$this

$this setApplication(Application $app)

Set the application instance used by the manager.

Parameters

Application $app

Return Value

$this

mixed __call(string $method, array $parameters)

Dynamically call the default driver instance.

Parameters

string $method
array $parameters

Return Value

mixed

Laravel Cloud is the best place to deploy Laravel, Nuxt, Express, Hono, Node.js, Bun, Go, Flask, Python, and more, with dedicated infrastructure available on AWS through Laravel Private Cloud.