skip to content

Disks & Drivers

Disks in config/filesystems.php map names to local, S3, FTP or SFTP drivers, and scoped, read-only or read-through disks wrap them. Interviewers probe the public disk symlink and S3-compatible setups.

on this pageshow

explore

questions

5

In Laravel, how do FILESYSTEM_DISK and Storage::disk() pick the disk a Storage call writes to, and what does moving uploads to S3 require?

level: middleimportance: must knowfreq 60%

basics

~20 s

Storage calls without disk() go to the default disk, config filesystems.default, read from FILESYSTEM_DISK and falling back to local. Storage::disk('s3') picks a named disk. Moving to S3 needs the Flysystem S3 package, AWS credentials and bucket settings.

open as a page

In Laravel's s3 disk configuration, what do AWS_ENDPOINT, AWS_USE_PATH_STYLE_ENDPOINT and AWS_URL change when the disk points at an S3-compatible service?

level: middleimportance: should knowfreq 38%

basics

~20 s

AWS_ENDPOINT feeds the s3 disk's endpoint key, sending API calls to another S3-compatible host. AWS_USE_PATH_STYLE_ENDPOINT puts the bucket in the URL path instead of the hostname. AWS_URL sets the base URL Laravel uses for public file links.

open as a page

In Laravel 13, how would a read-through disk let a design-portfolio site move its uploads from the public disk to S3 without downtime, and what does it leave undone?

level: seniorimportance: should knowfreq 22%

basics

~20 s

A read-through disk (added in Laravel 13.26) reads the primary disk first, falls back to the old disk and copies the file forward. Writes and listings use the primary only, so unread files still need a backfill.

open as a page

In Laravel, what do scoped and read-only disks add on top of an existing disk, and when would you create a disk at runtime with Storage::build()?

level: seniorimportance: should knowfreq 28%

basics

~20 s

A scoped disk prefixes every path of another disk; a read-only disk (read-only => true) rejects writes. Storage::build() creates an uncached disk from a config array or a local root path, for settings known only at runtime.

open as a page