Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

KodaC's avatar
Level 1

Add Disk to filesystems.php - No Access after Upload

I have added another disk in filesystems.php

        'public' => [
            'driver' => 'local',
            'root' => storage_path('app/public'),
            'url' => env('APP_URL') . '/storage',
            'visibility' => 'public',
            'throw' => false,
        ],

        'img-uploads' => [
            'driver' => 'local',
            'root' => storage_path('app/public/content/imgs'),
            'url' => env('APP_URL') . '/storage/content/imgs',
            'visibility' => 'public',
            'throw' => false,
        ],

I upload the image and want to resize it afterwards. I have already used this code when I did not create a separate disc.

$img = $request->file('image')->store('img-uploads');
$imgPath = Storage::disk('public')->path($img);
$imgManager = ImageManagerStatic::make($imgPath);
$imgManager->resize(300, 300, function ($constraint) {
    $constraint->aspectRatio();
})->save($imgPath);

With this I now get the error Image source not readable.

In the folder laravel/storage/app/imgs/ the image is present, but I can't find the folder under laravel/public/storage. storage:link was executed (But before I added a disc).

Shouldn't the path actually be laravel/storage/app/public/imgs/?

0 likes
4 replies
KodaC's avatar
Level 1

Shouldn't I see a folder under laravel/public/storage/ then (which is currently not the case)?

1 like
Pixolantis's avatar
Level 2

You are still using the Public folder. You can adjust this as follows

$img = $request->file('image')->store(options: 'img-uploads');
$imgPath = Storage::disk('img-uploads')->path($img);
2 likes

Please or to participate in this conversation.