Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4791 pages
Node.js, PHP and APIs

Laravel cannot find a storage disk by the name your code asks for

Your error

InvalidArgumentException: Disk [videos] does not have a configured driver.1 more line it can show

Fix it fast

Most common cause, 1 of 3

No disk with that name is defined in config/filesystems.php

Add the disk under disks with a driver and the options that driver needs.

Fix
// config/filesystems.php
'disks' => [
    // ... local, public, s3
    'videos' => [
        'driver' => 'local',
        'root' => storage_path('app/videos'),
    ],
],
Did this fix it?
Full steps for this cause: check, fix, verify

Short answer

InvalidArgumentException "Disk [videos] does not have a configured driver" means Laravel looked up filesystems.disks.videos and found no driver key. The disk is missing from config/filesystems.php, was added after config:cache built the cached copy, or the default disk in FILESYSTEM_DISK names one that does not exist. Define the disk, then clear the config cache. Applies to Laravel 12 and 13.

  • Applies to Laravel 13.43 (PHP 8.3 to 8.5), Laravel 12 (PHP 8.2 to 8.5)
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Which cause do you have?

Print the filesystem configuration that Laravel actually loaded. If the disk name from the error is not under disks, or default shows a name you did not define, you know which cause applies.

Run this first
php artisan config:show filesystems

Then find the line you see in this list and open its fix:

  1. 1No disk with that name is defined in config/filesystems.phpconfig:show filesystems lists only local, public and s3 (the defaults), and the name in the error is not among them
  2. 2The disk was added after the configuration was cachedThe disk is in config/filesystems.php, yet config:show does not list it, and bootstrap/cache/config.php exists
  3. 3The default disk points at a name that is not definedThe error appears on Storage::put() or Storage::url() calls without disk(), and the default value in config:show is not one of the disk names

What does the error look like?

  • InvalidArgumentException: Disk [videos] does not have a configured driver.
  • Disk [s3-backups] does not have a configured driver.

Cause 1 of 3

No disk with that name is defined in config/filesystems.php

You seeconfig:show filesystems lists only local, public and s3 (the defaults), and the name in the error is not among them

Check

The Disk [...] does not have a configured driver error comes from the filesystem manager when filesystems.disks.<name> returns nothing, so there is no driver to build. Storage::disk('videos') and packages that take a disk name, such as video or media libraries, all resolve the name through the disks array.

Check
grep -n "'videos'" config/filesystems.php

Fix

Add the disk under disks with a driver and the options that driver needs. A local disk only needs a root folder.

Fix
// config/filesystems.php
'disks' => [
    // ... local, public, s3
    'videos' => [
        'driver' => 'local',
        'root' => storage_path('app/videos'),
    ],
],

Verify

The loaded configuration now shows the disk with its driver, and the call that failed goes through.

Verify
php artisan config:show filesystems | grep -A3 videos

Confirmed by raw.githubusercontent.com

Did this fix it?

Cause 2 of 3

The disk was added after the configuration was cached

You seeThe disk is in config/filesystems.php, yet config:show does not list it, and bootstrap/cache/config.php exists

Check

With a cached configuration Laravel reads bootstrap/cache/config.php and ignores later edits to the files in config/. A disk added after php artisan config:cache therefore does not exist for the running app, and the lookup fails exactly as if it had never been written.

Check
ls -l bootstrap/cache/config.php config/filesystems.php

Fix

Clear the cached configuration, and rebuild it as the last step of the deploy if you use caching in production.

Fix
php artisan config:clear
# production deploys
php artisan config:cache

Verify

config:show now lists the new disk.

Verify
php artisan config:show filesystems

Confirmed by laravel.com

Did this fix it?

Cause 3 of 3

The default disk points at a name that is not defined

You seeThe error appears on Storage::put() or Storage::url() calls without disk(), and the default value in config:show is not one of the disk names

Check

Calls on the Storage facade without disk() go to the default disk, read from filesystems.default. The skeleton fills it from FILESYSTEM_DISK and falls back to local, so a typo in .env, or a value copied from another project, produces the same missing-driver error for a disk nobody named in code.

Check
grep -n '^FILESYSTEM_DISK' .env

Fix

Set FILESYSTEM_DISK to a disk that exists (local, public, s3 or one you added), then clear the config cache.

Fix
# .env
FILESYSTEM_DISK=public

php artisan config:clear

Verify

The default shown by config:show matches a key under disks.

Verify
php artisan config:show filesystems

Confirmed by github.com

Did this fix it?

How do I stop it coming back?

  • Keep every disk the code names in config/filesystems.php under version control, and refer to it through a constant or config value instead of a string typed in many places.
  • Make php artisan config:cache the last step of each deploy, after the new code and .env are in place.
  • Add a test that calls Storage::disk() for each disk name the app uses, so a removed or misspelled disk fails CI.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine on the same stack: Spotless Laundry, EZ Estimater.

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.